Completed
Push — master ( f2008e...da65df )
by cam
02:08
created
ecrire/tests/Rubriques/CreerRubriqueNommeeTest.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,14 +9,14 @@  discard block
 block discarded – undo
9 9
 
10 10
 class CreerRubriqueNommeeTest extends SquelettesTestCase
11 11
 {
12
-	/**
13
-	 * La fonction creer_rubrique_nommee('a/b/c/d') creee une arborescence et renvoie l'id_rubrique
14
-	 * Ici on en prend 10 au pif et on essaie de voir si on retombe bien dessus (attention, le
15
-	 * test est potentiellement "destructeur" (ou plutot "constructeur", puisqu'il creera des
16
-	 * rubriques superflues) si la fonction echoue, ou si deux rubriques soeurs portent le meme titre).
17
-	 */
18
-	public function testCreerRubriqueNommee(): void {
19
-		$this->assertOkCode(<<<SPIP
12
+    /**
13
+     * La fonction creer_rubrique_nommee('a/b/c/d') creee une arborescence et renvoie l'id_rubrique
14
+     * Ici on en prend 10 au pif et on essaie de voir si on retombe bien dessus (attention, le
15
+     * test est potentiellement "destructeur" (ou plutot "constructeur", puisqu'il creera des
16
+     * rubriques superflues) si la fonction echoue, ou si deux rubriques soeurs portent le meme titre).
17
+     */
18
+    public function testCreerRubriqueNommee(): void {
19
+        $this->assertOkCode(<<<SPIP
20 20
 			<BOUCLE_r(RUBRIQUES){par hasard}{0,10}>
21 21
 			[(#SET{hier,''})]
22 22
 			<BOUCLE_h(HIERARCHIE){tout}>
@@ -30,5 +30,5 @@  discard block
 block discarded – undo
30 30
 			</BOUCLE_r>
31 31
 			[(#GET{bug}|?{'',OK})]
32 32
 		SPIP);
33
-	}
33
+    }
34 34
 }
Please login to merge, or discard this patch.
ecrire/tests/Xml/XmlHackTest.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -13,27 +13,27 @@
 block discarded – undo
13 13
  */
14 14
 class XmlHackTest extends SquelettesTestCase
15 15
 {
16
-	#[DataProvider('providerXmlIsNotPhp')]
17
-	public function testXmlIsNotPhp(string $squelette): void {
18
-		$skel = $this->relativePath(__DIR__ . '/data/' . $squelette);
19
-		$out = recuperer_fond($skel, [], [
20
-			'raw' => true,
21
-			'trim' => true
22
-		]);
23
-		$this->assertEmpty($out['erreur'] ?? null);
24
-		$this->assertNotEmpty($out['texte']);
25
-		$xml = simplexml_load_string($out['texte']);
26
-		$this->assertOk((string) $xml[0]);
27
-	}
16
+    #[DataProvider('providerXmlIsNotPhp')]
17
+    public function testXmlIsNotPhp(string $squelette): void {
18
+        $skel = $this->relativePath(__DIR__ . '/data/' . $squelette);
19
+        $out = recuperer_fond($skel, [], [
20
+            'raw' => true,
21
+            'trim' => true
22
+        ]);
23
+        $this->assertEmpty($out['erreur'] ?? null);
24
+        $this->assertNotEmpty($out['texte']);
25
+        $xml = simplexml_load_string($out['texte']);
26
+        $this->assertOk((string) $xml[0]);
27
+    }
28 28
 
29
-	public static function providerXmlIsNotPhp(): array {
30
-		return [
31
-			['xmlhack'],
32
-			['xmlhack_php'],
33
-			['xmlhack_inclure'],
34
-			['xmlhack_inclure_php'],
35
-			['xmlhack_inclure_dyn'],
36
-			['xmlhack_inclure_dyn_php'],
37
-		];
38
-	}
29
+    public static function providerXmlIsNotPhp(): array {
30
+        return [
31
+            ['xmlhack'],
32
+            ['xmlhack_php'],
33
+            ['xmlhack_inclure'],
34
+            ['xmlhack_inclure_php'],
35
+            ['xmlhack_inclure_dyn'],
36
+            ['xmlhack_inclure_dyn_php'],
37
+        ];
38
+    }
39 39
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 {
16 16
 	#[DataProvider('providerXmlIsNotPhp')]
17 17
 	public function testXmlIsNotPhp(string $squelette): void {
18
-		$skel = $this->relativePath(__DIR__ . '/data/' . $squelette);
18
+		$skel = $this->relativePath(__DIR__.'/data/'.$squelette);
19 19
 		$out = recuperer_fond($skel, [], [
20 20
 			'raw' => true,
21 21
 			'trim' => true
Please login to merge, or discard this patch.
ecrire/tests/Testing/SquelettesTestCaseTest.php 1 patch
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -9,44 +9,44 @@
 block discarded – undo
9 9
 
10 10
 class SquelettesTestCaseTest extends SquelettesTestCase
11 11
 {
12
-	public function testAssertOk(): void {
13
-		$this->assertOk('ok');
14
-		$this->assertOk('Ok');
15
-		$this->assertOk('OK');
16
-		$this->assertOk('OK NOK NA');
17
-	}
18
-
19
-	public function testAssertOkExceptionNok(): void {
20
-		$this->expectException(AssertionFailedError::class);
21
-		$this->assertOk('NOK');
22
-	}
23
-
24
-	public function testAssertOkExceptionNa(): void {
25
-		$this->expectException(AssertionFailedError::class);
26
-		$this->assertOk('NA');
27
-	}
28
-
29
-	public function testAssertNotOk() {
30
-		$this->assertNotOk('nOK');
31
-		$this->assertNotOk('NOK');
32
-		$this->assertNotOk('Nok');
33
-		$this->assertNotOk('Nok OK NA');
34
-	}
35
-
36
-	public function testAssertNotOkExceptionOk(): void {
37
-		$this->expectException(AssertionFailedError::class);
38
-		$this->assertNotOk('OK');
39
-	}
40
-
41
-	public function testAssertNotOkExceptionNa(): void {
42
-		$this->expectException(AssertionFailedError::class);
43
-		$this->assertOk('Na');
44
-	}
45
-
46
-	public function testIsNa(): void {
47
-		$this->assertTrue($this->isNa(' NA texte'));
48
-		$this->assertTrue($this->isNa('na texte'));
49
-		$this->assertfalse($this->isNa('texte NA'));
50
-		$this->assertfalse($this->isNa('texte'));
51
-	}
12
+    public function testAssertOk(): void {
13
+        $this->assertOk('ok');
14
+        $this->assertOk('Ok');
15
+        $this->assertOk('OK');
16
+        $this->assertOk('OK NOK NA');
17
+    }
18
+
19
+    public function testAssertOkExceptionNok(): void {
20
+        $this->expectException(AssertionFailedError::class);
21
+        $this->assertOk('NOK');
22
+    }
23
+
24
+    public function testAssertOkExceptionNa(): void {
25
+        $this->expectException(AssertionFailedError::class);
26
+        $this->assertOk('NA');
27
+    }
28
+
29
+    public function testAssertNotOk() {
30
+        $this->assertNotOk('nOK');
31
+        $this->assertNotOk('NOK');
32
+        $this->assertNotOk('Nok');
33
+        $this->assertNotOk('Nok OK NA');
34
+    }
35
+
36
+    public function testAssertNotOkExceptionOk(): void {
37
+        $this->expectException(AssertionFailedError::class);
38
+        $this->assertNotOk('OK');
39
+    }
40
+
41
+    public function testAssertNotOkExceptionNa(): void {
42
+        $this->expectException(AssertionFailedError::class);
43
+        $this->assertOk('Na');
44
+    }
45
+
46
+    public function testIsNa(): void {
47
+        $this->assertTrue($this->isNa(' NA texte'));
48
+        $this->assertTrue($this->isNa('na texte'));
49
+        $this->assertfalse($this->isNa('texte NA'));
50
+        $this->assertfalse($this->isNa('texte'));
51
+    }
52 52
 }
Please login to merge, or discard this patch.
ecrire/tests/Testing/TemplateTest.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,14 +9,14 @@
 block discarded – undo
9 9
 
10 10
 class TemplateTest extends SquelettesTestCase
11 11
 {
12
-	public function testNativeRecupererFond(): void {
13
-		$dir = $this->relativePath(__DIR__);
14
-		$this->assertEquals('Hello World', recuperer_fond($dir . '/data/texte_hello_world'));
15
-	}
12
+    public function testNativeRecupererFond(): void {
13
+        $dir = $this->relativePath(__DIR__);
14
+        $this->assertEquals('Hello World', recuperer_fond($dir . '/data/texte_hello_world'));
15
+    }
16 16
 
17
-	public function testRenderer(): void {
18
-		$dir = $this->relativePath(__DIR__);
19
-		$template = new Template($dir . '/data/texte_hello_world');
20
-		$this->assertEquals('Hello World', $template->render());
21
-	}
17
+    public function testRenderer(): void {
18
+        $dir = $this->relativePath(__DIR__);
19
+        $template = new Template($dir . '/data/texte_hello_world');
20
+        $this->assertEquals('Hello World', $template->render());
21
+    }
22 22
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@
 block discarded – undo
11 11
 {
12 12
 	public function testNativeRecupererFond(): void {
13 13
 		$dir = $this->relativePath(__DIR__);
14
-		$this->assertEquals('Hello World', recuperer_fond($dir . '/data/texte_hello_world'));
14
+		$this->assertEquals('Hello World', recuperer_fond($dir.'/data/texte_hello_world'));
15 15
 	}
16 16
 
17 17
 	public function testRenderer(): void {
18 18
 		$dir = $this->relativePath(__DIR__);
19
-		$template = new Template($dir . '/data/texte_hello_world');
19
+		$template = new Template($dir.'/data/texte_hello_world');
20 20
 		$this->assertEquals('Hello World', $template->render());
21 21
 	}
22 22
 }
Please login to merge, or discard this patch.
ecrire/tests/Testing/TemplatingTest.php 2 patches
Indentation   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -13,137 +13,137 @@
 block discarded – undo
13 13
 
14 14
 class TemplatingTest extends SquelettesTestCase
15 15
 {
16
-	public function testFileLoader(): void {
17
-		$loader = new FileLoader();
18
-		$templating = new Templating($loader);
19
-		$this->assertInstanceOf(FileLoader::class, $templating->getLoader());
20
-		$this->assertEquals($loader, $templating->getLoader());
21
-
22
-		$file = __DIR__ . '/data/texte_hello_world.html';
23
-		$expected = trim(file_get_contents($file));
24
-
25
-		// Indirect render
26
-		$template = $templating->load($file);
27
-		$actual = $template->render();
28
-		$this->assertEquals($expected, $actual);
29
-
30
-		// Quick render
31
-		$actual = $templating->render($file);
32
-		$this->assertEquals($expected, $actual);
33
-
34
-		// Assert render
35
-		$this->assertEqualsTemplate($expected, $templating, $file);
36
-	}
37
-
38
-	public function testFileLoaderException(): void {
39
-		$templating = new Templating(new FileLoader());
40
-		$file = __DIR__ . '/data/inexistant_file.html';
41
-		$this->expectException(TemplateNotFoundException::class);
42
-		$templating->render($file);
43
-	}
44
-
45
-	public function testStringLoader(): void {
46
-		$templating = Templating::fromString();
47
-		$expected = 'Hello World';
48
-		$actual = $templating->render($expected);
49
-		$this->assertEquals($expected, $actual);
50
-	}
51
-
52
-	public function testChainLoader(): void {
53
-		$template = new Templating(new ChainLoader([new FileLoader(), new StringLoader()]));
54
-
55
-		$file = __DIR__ . '/data/texte_hello_world.html';
56
-		$expected = trim(file_get_contents($file));
57
-		$actual = $template->render($file);
58
-		$this->assertEquals($expected, $actual);
59
-
60
-		$string = 'Not a file';
61
-		$actual = $template->render($string);
62
-		$this->assertEquals($string, $actual);
63
-	}
64
-
65
-	public function testCodeRenderAvecFonctionEtApresCode(): void {
66
-		$loader = new StringLoader([
67
-			'fonctions' => "
16
+    public function testFileLoader(): void {
17
+        $loader = new FileLoader();
18
+        $templating = new Templating($loader);
19
+        $this->assertInstanceOf(FileLoader::class, $templating->getLoader());
20
+        $this->assertEquals($loader, $templating->getLoader());
21
+
22
+        $file = __DIR__ . '/data/texte_hello_world.html';
23
+        $expected = trim(file_get_contents($file));
24
+
25
+        // Indirect render
26
+        $template = $templating->load($file);
27
+        $actual = $template->render();
28
+        $this->assertEquals($expected, $actual);
29
+
30
+        // Quick render
31
+        $actual = $templating->render($file);
32
+        $this->assertEquals($expected, $actual);
33
+
34
+        // Assert render
35
+        $this->assertEqualsTemplate($expected, $templating, $file);
36
+    }
37
+
38
+    public function testFileLoaderException(): void {
39
+        $templating = new Templating(new FileLoader());
40
+        $file = __DIR__ . '/data/inexistant_file.html';
41
+        $this->expectException(TemplateNotFoundException::class);
42
+        $templating->render($file);
43
+    }
44
+
45
+    public function testStringLoader(): void {
46
+        $templating = Templating::fromString();
47
+        $expected = 'Hello World';
48
+        $actual = $templating->render($expected);
49
+        $this->assertEquals($expected, $actual);
50
+    }
51
+
52
+    public function testChainLoader(): void {
53
+        $template = new Templating(new ChainLoader([new FileLoader(), new StringLoader()]));
54
+
55
+        $file = __DIR__ . '/data/texte_hello_world.html';
56
+        $expected = trim(file_get_contents($file));
57
+        $actual = $template->render($file);
58
+        $this->assertEquals($expected, $actual);
59
+
60
+        $string = 'Not a file';
61
+        $actual = $template->render($string);
62
+        $this->assertEquals($string, $actual);
63
+    }
64
+
65
+    public function testCodeRenderAvecFonctionEtApresCode(): void {
66
+        $loader = new StringLoader([
67
+            'fonctions' => "
68 68
 				function so_smile(): string {
69 69
 					return ' So Smile';
70 70
 				}
71 71
 			",
72
-			'apres_code' => '[(#VAL|so_smile)]',
73
-		]);
74
-		$templating = new Templating($loader);
75
-		$this->assertEquals('Hello World So Smile', $templating->render('Hello World'));
72
+            'apres_code' => '[(#VAL|so_smile)]',
73
+        ]);
74
+        $templating = new Templating($loader);
75
+        $this->assertEquals('Hello World So Smile', $templating->render('Hello World'));
76 76
 
77
-		$templating = Templating::fromString([
78
-			'fonctions' => "
77
+        $templating = Templating::fromString([
78
+            'fonctions' => "
79 79
 				function so_smile(): string {
80 80
 					return ' So Smile';
81 81
 				}
82 82
 			",
83
-			'apres_code' => '[(#VAL|so_smile)]',
84
-		]);
85
-		$this->assertEquals('Hello World So Smile', $templating->render('Hello World'));
86
-	}
87
-
88
-	public function testCodeRenderAvecFonctionPrecedenteNonPresente(): void {
89
-		$template = Templating::fromString();
90
-		$this->assertNotEquals('Hello World So Smile', $template->render('Hello World'));
91
-		$this->assertEquals('Hello World', $template->render('Hello World'));
92
-		$this->assertNotEquals('Hello Kitty So Smile', $template->render('Hello Kitty'));
93
-		$this->assertEquals('Hello Kitty', $template->render('Hello Kitty'));
94
-	}
95
-
96
-	public function testCodeRender(): void {
97
-		$this->assertEqualsCode('Hello World', 'Hello World');
98
-	}
99
-
100
-	public function testCodeRenderAvecFonctionVide(): void {
101
-		// pas de fichier de fonctions
102
-		$this->assertOkCode("[(#SQUELETTE|replace{'.html','_fonctions.php'}|find_in_path|non)ok]");
103
-
104
-		// fichier de fonction
105
-		$templating = Templating::fromString([
106
-			'fonctions' => "
83
+            'apres_code' => '[(#VAL|so_smile)]',
84
+        ]);
85
+        $this->assertEquals('Hello World So Smile', $templating->render('Hello World'));
86
+    }
87
+
88
+    public function testCodeRenderAvecFonctionPrecedenteNonPresente(): void {
89
+        $template = Templating::fromString();
90
+        $this->assertNotEquals('Hello World So Smile', $template->render('Hello World'));
91
+        $this->assertEquals('Hello World', $template->render('Hello World'));
92
+        $this->assertNotEquals('Hello Kitty So Smile', $template->render('Hello Kitty'));
93
+        $this->assertEquals('Hello Kitty', $template->render('Hello Kitty'));
94
+    }
95
+
96
+    public function testCodeRender(): void {
97
+        $this->assertEqualsCode('Hello World', 'Hello World');
98
+    }
99
+
100
+    public function testCodeRenderAvecFonctionVide(): void {
101
+        // pas de fichier de fonctions
102
+        $this->assertOkCode("[(#SQUELETTE|replace{'.html','_fonctions.php'}|find_in_path|non)ok]");
103
+
104
+        // fichier de fonction
105
+        $templating = Templating::fromString([
106
+            'fonctions' => "
107 107
 				function so_smile(): string {
108 108
 					return ' So Smile';
109 109
 				}
110 110
 			",
111
-		]);
112
-		$this->assertOk($templating->render("[(#SQUELETTE|replace{'.html','_fonctions.php'}|find_in_path|oui)ok]"));
113
-
114
-		// pas de fichier de fonctions
115
-		$templating = Templating::fromString();
116
-		$this->assertNotOk($templating->render("[(#SQUELETTE|replace{'.html','_fonctions.php'}|find_in_path|oui)ok]"));
117
-	}
118
-
119
-	public function testCodeRenderAvantApres(): void {
120
-		$templating = Templating::fromString([
121
-			'avant_code' => 'Nice ',
122
-			'apres_code' => ' So Beautiful',
123
-		]);
124
-		$this->assertEquals('Nice Hello World So Beautiful', $templating->render('Hello World'));
125
-	}
126
-
127
-	public function testCodeRawRenderInfos(): void {
128
-		$templating = Templating::fromString();
129
-		$infos = $templating->rawRender('#SELF');
130
-		$this->assertTrue(is_array($infos));
131
-		$this->assertTrue(isset($infos['squelette']));
132
-		$this->assertTrue(isset($infos['fond']));
133
-	}
134
-
135
-	public function testCodeRawRenderInfosErreurCompilationFiltreAbsent(): void {
136
-		$templating = Templating::fromString();
137
-
138
-		$infos = $templating->rawRender('#CACHE{0}[(#SELF|ce_filtre_nexiste_pas)]');
139
-		$this->assertTrue(is_array($infos['erreurs']));
140
-		$this->assertCount(1, $infos['erreurs']);
141
-	}
142
-
143
-	public function testCodeRawRenderInfosErreurCompilationAbsentsDansNouvelleDemandeCorrecte(): void {
144
-		$templating = Templating::fromString();
145
-
146
-		$infos = $templating->rawRender('#CACHE{0}Aucun Probleme ici');
147
-		$this->assertCount(0, $infos['erreurs']);
148
-	}
111
+        ]);
112
+        $this->assertOk($templating->render("[(#SQUELETTE|replace{'.html','_fonctions.php'}|find_in_path|oui)ok]"));
113
+
114
+        // pas de fichier de fonctions
115
+        $templating = Templating::fromString();
116
+        $this->assertNotOk($templating->render("[(#SQUELETTE|replace{'.html','_fonctions.php'}|find_in_path|oui)ok]"));
117
+    }
118
+
119
+    public function testCodeRenderAvantApres(): void {
120
+        $templating = Templating::fromString([
121
+            'avant_code' => 'Nice ',
122
+            'apres_code' => ' So Beautiful',
123
+        ]);
124
+        $this->assertEquals('Nice Hello World So Beautiful', $templating->render('Hello World'));
125
+    }
126
+
127
+    public function testCodeRawRenderInfos(): void {
128
+        $templating = Templating::fromString();
129
+        $infos = $templating->rawRender('#SELF');
130
+        $this->assertTrue(is_array($infos));
131
+        $this->assertTrue(isset($infos['squelette']));
132
+        $this->assertTrue(isset($infos['fond']));
133
+    }
134
+
135
+    public function testCodeRawRenderInfosErreurCompilationFiltreAbsent(): void {
136
+        $templating = Templating::fromString();
137
+
138
+        $infos = $templating->rawRender('#CACHE{0}[(#SELF|ce_filtre_nexiste_pas)]');
139
+        $this->assertTrue(is_array($infos['erreurs']));
140
+        $this->assertCount(1, $infos['erreurs']);
141
+    }
142
+
143
+    public function testCodeRawRenderInfosErreurCompilationAbsentsDansNouvelleDemandeCorrecte(): void {
144
+        $templating = Templating::fromString();
145
+
146
+        $infos = $templating->rawRender('#CACHE{0}Aucun Probleme ici');
147
+        $this->assertCount(0, $infos['erreurs']);
148
+    }
149 149
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 		$this->assertInstanceOf(FileLoader::class, $templating->getLoader());
20 20
 		$this->assertEquals($loader, $templating->getLoader());
21 21
 
22
-		$file = __DIR__ . '/data/texte_hello_world.html';
22
+		$file = __DIR__.'/data/texte_hello_world.html';
23 23
 		$expected = trim(file_get_contents($file));
24 24
 
25 25
 		// Indirect render
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
 	public function testFileLoaderException(): void {
39 39
 		$templating = new Templating(new FileLoader());
40
-		$file = __DIR__ . '/data/inexistant_file.html';
40
+		$file = __DIR__.'/data/inexistant_file.html';
41 41
 		$this->expectException(TemplateNotFoundException::class);
42 42
 		$templating->render($file);
43 43
 	}
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	public function testChainLoader(): void {
53 53
 		$template = new Templating(new ChainLoader([new FileLoader(), new StringLoader()]));
54 54
 
55
-		$file = __DIR__ . '/data/texte_hello_world.html';
55
+		$file = __DIR__.'/data/texte_hello_world.html';
56 56
 		$expected = trim(file_get_contents($file));
57 57
 		$actual = $template->render($file);
58 58
 		$this->assertEquals($expected, $actual);
Please login to merge, or discard this patch.
ecrire/tests/Squelettes/Critere/OrigineTraductionTest.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -11,27 +11,27 @@  discard block
 block discarded – undo
11 11
 class OrigineTraductionTest extends SquelettesTestCase
12 12
 {
13 13
 
14
-	/** Un article non traduit est bien {origine_traduction} */
15
-	public function testArticleTraduitEstOrigineTraduction(): void {
16
-		$templating = Templating::fromString();
17
-		$result = $templating->render(<<<SPIP
14
+    /** Un article non traduit est bien {origine_traduction} */
15
+    public function testArticleTraduitEstOrigineTraduction(): void {
16
+        $templating = Templating::fromString();
17
+        $result = $templating->render(<<<SPIP
18 18
 		<BOUCLE_t(ARTICLES)/>[(#TOTAL_BOUCLE|<{2}|?{NA il faut des articles})]<//B_t>
19 19
 		<BOUCLE_ori(ARTICLES){origine_traduction}{id_trad=0}{0,1}> </BOUCLE_ori>
20 20
 		Erreur boucle origine
21 21
 		<//B_ori>
22 22
 		ok
23 23
 		SPIP);
24
-		if ($this->isNa($result)) {
25
-			$this->markTestSkipped($result);
26
-		}
24
+        if ($this->isNa($result)) {
25
+            $this->markTestSkipped($result);
26
+        }
27 27
 
28
-		$this->assertOk($result);
29
-	}
28
+        $this->assertOk($result);
29
+    }
30 30
 
31
-	/** Un article traduit n'a qu'une traduction qui est {origine_traduction} */
32
-	public function testArticleTraduitAUneSeuleTraductionOrigineTraduction(): void {
33
-		$templating = Templating::fromString();
34
-		$result = $templating->render(<<<SPIP
31
+    /** Un article traduit n'a qu'une traduction qui est {origine_traduction} */
32
+    public function testArticleTraduitAUneSeuleTraductionOrigineTraduction(): void {
33
+        $templating = Templating::fromString();
34
+        $result = $templating->render(<<<SPIP
35 35
 		<BOUCLE_ori2(ARTICLES){id_trad>0}{origine_traduction}>
36 36
 		<BOUCLE_casse(ARTICLES){traduction}{origine_traduction}{!id_article}>
37 37
 			Boum ! #ID_ARTICLE ne devrait pas etre origine
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
 		<//B_ori2>
42 42
 		OK
43 43
 		SPIP);
44
-		if ($this->isNa($result)) {
45
-			$this->markTestSkipped($result);
46
-		}
44
+        if ($this->isNa($result)) {
45
+            $this->markTestSkipped($result);
46
+        }
47 47
 
48
-		$this->assertOk($result);
49
-	}
48
+        $this->assertOk($result);
49
+    }
50 50
 }
Please login to merge, or discard this patch.
ecrire/tests/Squelettes/Critere/DoublonsTest.php 2 patches
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -10,58 +10,58 @@
 block discarded – undo
10 10
 
11 11
 class DoublonsTest extends SquelettesTestCase
12 12
 {
13
-	public function testCritereDoublons(): void {
14
-		$this->assertOkCode(
15
-			'
13
+    public function testCritereDoublons(): void {
14
+        $this->assertOkCode(
15
+            '
16 16
 			<BOUCLE_a(ARTICLES){statut=.*}{doublons}></BOUCLE_a>
17 17
 			<BOUCLE_b(ARTICLES){statut=.*}{tout}{doublons}{0,1}>Erreur doublons articles</BOUCLE_b>
18 18
 			ok<//B_b>
19 19
 			'
20
-		);
21
-		$this->assertOkCode(
22
-			'
20
+        );
21
+        $this->assertOkCode(
22
+            '
23 23
 			<BOUCLE_a(ARTICLES){doublons}></BOUCLE_a>
24 24
 			<BOUCLE_b(ARTICLES){doublons}{0,1}>Erreur doublons articles</BOUCLE_b>
25 25
 			ok<//B_b>
26 26
 			'
27
-		);
28
-	}
27
+        );
28
+    }
29 29
 
30
-	public function testCritereDoublonsMultiplesBoucles(): void {
31
-		$this->assertOkSquelette(__DIR__ . '/data/doublons.html');
32
-	}
30
+    public function testCritereDoublonsMultiplesBoucles(): void {
31
+        $this->assertOkSquelette(__DIR__ . '/data/doublons.html');
32
+    }
33 33
 
34
-	public function testDoublonsAuteurs(): void {
35
-		$templating = Templating::fromString();
36
-		$n = $templating->render('<BOUCLE_a(AUTEURS)>#COMPTEUR_BOUCLE</BOUCLE_a>');
34
+    public function testDoublonsAuteurs(): void {
35
+        $templating = Templating::fromString();
36
+        $n = $templating->render('<BOUCLE_a(AUTEURS)>#COMPTEUR_BOUCLE</BOUCLE_a>');
37 37
 
38
-		if ($n <= 1) {
39
-			$this->markTestSkipped('Il faut au moins 2 auteurs ayant publie sur le site !');
40
-		}
38
+        if ($n <= 1) {
39
+            $this->markTestSkipped('Il faut au moins 2 auteurs ayant publie sur le site !');
40
+        }
41 41
 
42
-		$this->assertOkCode('
42
+        $this->assertOkCode('
43 43
 			<BOUCLE_a(AUTEURS){doublons}></BOUCLE_a>
44 44
 			<BOUCLE_b(AUTEURS){doublons}{0,1}>Erreur doublons Auteurs</BOUCLE_b>OK<//B_b>
45 45
 		');
46
-	}
46
+    }
47 47
 
48
-	#[Depends('testDoublonsAuteurs')]
49
-	public function testDoublonsNommesAuteurs(): void {
50
-		$this->assertOkCode('
48
+    #[Depends('testDoublonsAuteurs')]
49
+    public function testDoublonsNommesAuteurs(): void {
50
+        $this->assertOkCode('
51 51
 			<BOUCLE_a(AUTEURS){doublons polisson}></BOUCLE_a>
52 52
 			<BOUCLE_b(AUTEURS){doublons polisson}{0,1}>Erreur doublons Auteurs</BOUCLE_b>OK<//B_b>
53 53
 		');
54
-		$this->assertOkCode('
54
+        $this->assertOkCode('
55 55
 			<BOUCLE_a(AUTEURS){1/2}{doublons kakis}></BOUCLE_a>
56 56
 			<BOUCLE_b(AUTEURS){2/2}{doublons kokos}></BOUCLE_b>
57 57
 			<BOUCLE_c(AUTEURS){doublons kakis}{0,1}>ok</BOUCLE_c>Erreur doubles doublons Auteurs<//B_c>
58 58
 		');
59
-		$this->assertOkCode('
59
+        $this->assertOkCode('
60 60
 			<BOUCLE_a(AUTEURS){1/2}{doublons kakis}></BOUCLE_a>
61 61
 			<BOUCLE_b(AUTEURS){2/2}{doublons kokos}></BOUCLE_b>
62 62
 			<BOUCLE_c(AUTEURS){doublons kakis}{0,1}> </BOUCLE_c>Erreur doubles doublons Auteurs<//B_c>
63 63
 			<BOUCLE_d(AUTEURS){doublons kokos}{0,1}> </BOUCLE_d>Erreur doubles doublons Auteurs<//B_d>
64 64
 			<BOUCLE_e(AUTEURS){doublons kakis}{doublons kokos}{0,1}>Erreur doubles doublons Auteurs</BOUCLE_e>OK<//B_e>
65 65
 		');
66
-	}
66
+    }
67 67
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 	}
29 29
 
30 30
 	public function testCritereDoublonsMultiplesBoucles(): void {
31
-		$this->assertOkSquelette(__DIR__ . '/data/doublons.html');
31
+		$this->assertOkSquelette(__DIR__.'/data/doublons.html');
32 32
 	}
33 33
 
34 34
 	public function testDoublonsAuteurs(): void {
Please login to merge, or discard this patch.
ecrire/tests/Squelettes/Critere/TraductionTest.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -11,10 +11,10 @@  discard block
 block discarded – undo
11 11
 class TraductionTest extends SquelettesTestCase
12 12
 {
13 13
 
14
-	/** Un article sans trad */
15
-	public function testArticleSansTraduction(): void {
16
-		$templating = Templating::fromString();
17
-		$result = $templating->render(<<<SPIP
14
+    /** Un article sans trad */
15
+    public function testArticleSansTraduction(): void {
16
+        $templating = Templating::fromString();
17
+        $result = $templating->render(<<<SPIP
18 18
 		<BOUCLE_principale(ARTICLES){id_trad=0}{0,1}>
19 19
 		<BOUCLE_check(ARTICLES){traduction}> </BOUCLE_check>
20 20
 			boucle check: le critere {traduction} a echoue
@@ -25,17 +25,17 @@  discard block
 block discarded – undo
25 25
 		<//B_principale>
26 26
 		ok
27 27
 		SPIP);
28
-		if ($this->isNa($result)) {
29
-			$this->markTestSkipped($result);
30
-		}
28
+        if ($this->isNa($result)) {
29
+            $this->markTestSkipped($result);
30
+        }
31 31
 
32
-		$this->assertOk($result);
33
-	}
32
+        $this->assertOk($result);
33
+    }
34 34
 
35
-	/** un article et ses traductions */
36
-	public function testArticleAvecTraductions(): void {
37
-		$templating = Templating::fromString();
38
-		$result = $templating->render(<<<SPIP
35
+    /** un article et ses traductions */
36
+    public function testArticleAvecTraductions(): void {
37
+        $templating = Templating::fromString();
38
+        $result = $templating->render(<<<SPIP
39 39
 		<BOUCLE_s(ARTICLES){id_trad>0}{0,1}>
40 40
 		<BOUCLE_t(ARTICLES){traduction}> </BOUCLE_t>
41 41
 		</BOUCLE_s>
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
 		<//B_s>
44 44
 		ok
45 45
 		SPIP);
46
-		if ($this->isNa($result)) {
47
-			$this->markTestSkipped($result);
48
-		}
46
+        if ($this->isNa($result)) {
47
+            $this->markTestSkipped($result);
48
+        }
49 49
 
50
-		$this->assertOk($result);
51
-	}
50
+        $this->assertOk($result);
51
+    }
52 52
 }
Please login to merge, or discard this patch.
ecrire/tests/Squelettes/Critere/BrancheTest.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -10,18 +10,18 @@  discard block
 block discarded – undo
10 10
 
11 11
 class BrancheTest extends SquelettesTestCase
12 12
 {
13
-	/**
14
-	 * 	Un test pour le critere {branche}
15
-	 *
16
-	 * 	verifie :
17
-	 * 	- une rubrique est dans sa branche
18
-	 * 	- sa fille est dans sa branche
19
-	 * 	- elle n'est pas dans la branche de sa fille
20
-	 *  - que la boucle documents compile sans erreur
21
-	 * 	- que la boucle articles compile sans erreur
22
-	 */
23
-	public function testCritereBranche(): void {
24
-		$this->assertOkCode(<<<SPIP
13
+    /**
14
+     * 	Un test pour le critere {branche}
15
+     *
16
+     * 	verifie :
17
+     * 	- une rubrique est dans sa branche
18
+     * 	- sa fille est dans sa branche
19
+     * 	- elle n'est pas dans la branche de sa fille
20
+     *  - que la boucle documents compile sans erreur
21
+     * 	- que la boucle articles compile sans erreur
22
+     */
23
+    public function testCritereBranche(): void {
24
+        $this->assertOkCode(<<<SPIP
25 25
 		<BOUCLE_a(RUBRIQUES){id_parent>0}>
26 26
 			<BOUCLE_b(RUBRIQUES){id_rubrique=#ID_PARENT}>
27 27
 				<BOUCLE_d(RUBRIQUES){branche}{id_rubrique}>
@@ -40,13 +40,13 @@  discard block
 block discarded – undo
40 40
 		</BOUCLE_a>
41 41
 		ok
42 42
 		SPIP);
43
-	}
43
+    }
44 44
 
45
-	public function testCompileBoucle(): void {
46
-		$this->assertOkCode(<<<SPIP
45
+    public function testCompileBoucle(): void {
46
+        $this->assertOkCode(<<<SPIP
47 47
 		<BOUCLE_art(ARTICLES){branche}{0,1}> </BOUCLE_art>
48 48
 		<BOUCLE_docs(DOCUMENTS){branche}{0,1}> </BOUCLE_docs>
49 49
 		OK
50 50
 		SPIP);
51
-	}
51
+    }
52 52
 }
Please login to merge, or discard this patch.