Completed
Push — master ( ffbbca...ad9227 )
by cam
01:32
created
ecrire/tests/Typographie/FrTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 	public static function setUpBeforeClass(): void {
29 29
 		include_spip('inc/texte');
30 30
 		changer_langue(static::$lang);
31
-		include_spip(static::$root . 'typographie/' . static::$lang);
31
+		include_spip(static::$root.'typographie/'.static::$lang);
32 32
 	}
33 33
 
34 34
 	public static function providerBase() {
Please login to merge, or discard this patch.
ecrire/tests/Typographie/NotesTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 		$expected = '<p>a<span class="spip_note_ref">&nbsp;[<a href="#nb1" class="spip_note" rel="appendix" title="b" id="nh1">1</a>]</span></p>';
22 22
 		$this->assertEquals($expected, propre('a[[b]]'));
23 23
 
24
-		$expected = "<div id=\"nb1\">\n<p><span class=\"spip_note_ref\">[<a href=\"#nh1\" class=\"spip_note\" title=\"" . _T('info_notes') . " 1\" rev=\"appendix\">1</a>]&nbsp;</span>b</p>\n</div>";
24
+		$expected = "<div id=\"nb1\">\n<p><span class=\"spip_note_ref\">[<a href=\"#nh1\" class=\"spip_note\" title=\""._T('info_notes')." 1\" rev=\"appendix\">1</a>]&nbsp;</span>b</p>\n</div>";
25 25
 		$this->assertEquals($expected, calculer_notes());
26 26
 	}
27 27
 
Please login to merge, or discard this patch.
ecrire/tests/Filtre/Form/FormHiddenCase.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -65,50 +65,50 @@  discard block
 block discarded – undo
65 65
 		return [
66 66
 			0 =>
67 67
 			[
68
-				0 => '<input name="id_rubrique" value="' . $id . '" type="hidden"
68
+				0 => '<input name="id_rubrique" value="'.$id.'" type="hidden"
69 69
 /><input name="page" value="rubrique" type="hidden"
70 70
 />',
71
-				1 => './?rubrique' . $id,
71
+				1 => './?rubrique'.$id,
72 72
 			],
73 73
 			1 =>
74 74
 			[
75 75
 				0 => '<input name="calendrier" value="1" type="hidden"
76
-/><input name="id_rubrique" value="' . $id . '" type="hidden"
76
+/><input name="id_rubrique" value="' . $id.'" type="hidden"
77 77
 /><input name="page" value="rubrique" type="hidden"
78 78
 />',
79
-				1 => './?rubrique' . $id . '&calendrier=1',
79
+				1 => './?rubrique'.$id.'&calendrier=1',
80 80
 			],
81 81
 			2 =>
82 82
 			[
83
-				0 => '<input name="id_rubrique" value="' . $id . '" type="hidden"
83
+				0 => '<input name="id_rubrique" value="'.$id.'" type="hidden"
84 84
 /><input name="page" value="rubrique" type="hidden"
85 85
 />',
86
-				1 => './rubrique' . $id . '.html',
86
+				1 => './rubrique'.$id.'.html',
87 87
 			],
88 88
 			3 =>
89 89
 			[
90 90
 				0 => '<input name="calendrier" value="1" type="hidden"
91
-/><input name="id_rubrique" value="' . $id . '" type="hidden"
91
+/><input name="id_rubrique" value="' . $id.'" type="hidden"
92 92
 /><input name="page" value="rubrique" type="hidden"
93 93
 />',
94
-				1 => './rubrique' . $id . '.html?calendrier=1',
94
+				1 => './rubrique'.$id.'.html?calendrier=1',
95 95
 			],
96 96
 			4 =>
97 97
 			[
98 98
 				0 => '<input name="calendrier" value="1" type="hidden"
99
-/><input name="id_rubrique" value="' . $id . '" type="hidden"
99
+/><input name="id_rubrique" value="' . $id.'" type="hidden"
100 100
 /><input name="page" value="rubrique" type="hidden"
101 101
 />',
102
-				1 => './?rubrique' . $id . '&amp;calendrier=1',
102
+				1 => './?rubrique'.$id.'&amp;calendrier=1',
103 103
 			],
104 104
 			5 =>
105 105
 			[
106 106
 				0 => '<input name="calendrier" value="1" type="hidden"
107 107
 /><input name="toto" value="2" type="hidden"
108
-/><input name="id_rubrique" value="' . $id . '" type="hidden"
108
+/><input name="id_rubrique" value="' . $id.'" type="hidden"
109 109
 /><input name="page" value="rubrique" type="hidden"
110 110
 />',
111
-				1 => './rubrique' . $id . '.html?calendrier=1&amp;toto=2',
111
+				1 => './rubrique'.$id.'.html?calendrier=1&amp;toto=2',
112 112
 			],
113 113
 		];
114 114
 	}
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 		$id_rubrique = sql_getfetsel(
119 119
 			'id_rubrique',
120 120
 			'spip_rubriques',
121
-			['statut = ' . sql_quote('publie')],
121
+			['statut = '.sql_quote('publie')],
122 122
 			limit: '0, 1',
123 123
 		);
124 124
 		return $id_rubrique ? (int) $id_rubrique : null;
Please login to merge, or discard this patch.
ecrire/tests/Filtre/ExtraireBalisesTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	}
49 49
 
50 50
 	public function testFiltresExtraireBalisesMediaRss(): void {
51
-		$rss = file_get_contents(dirname(__DIR__) . '/Fixtures/data/dailymotion.rss');
51
+		$rss = file_get_contents(dirname(__DIR__).'/Fixtures/data/dailymotion.rss');
52 52
 		if (empty($rss)) {
53 53
 			$this->markTestSkipped();
54 54
 		}
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 		return [
63 63
 			[['<a href="truc">chose</a>'], 'allo <a href="truc">chose</a>'],
64 64
 			[['<a href="truc" />'], 'allo <a href="truc" />'],
65
-			[["<a\nhref='truc' />"], 'allo' . "\n" . " <a\nhref='truc' />"],
65
+			[["<a\nhref='truc' />"], 'allo'."\n"." <a\nhref='truc' />"],
66 66
 			[[['<a href="1">'], ['<a href="2">']], ['allo <a href="1">', 'allo <a href="2">']],
67 67
 			[['<a href="truc">chose</a>'], 'bonjour <a href="truc">chose</a> machin'],
68 68
 			[
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 			[['<a>chose</a>'], '<a>chose</a>'],
75 75
 			[['<a href="truc">chose</a>'], 'allo <a href="truc">chose</a>', 'a'],
76 76
 			[['<a href="truc" />'], 'allo <a href="truc" />', 'a'],
77
-			[["<a\nhref='truc' />"], 'allo' . "\n" . " <a\nhref='truc' />", 'a'],
77
+			[["<a\nhref='truc' />"], 'allo'."\n"." <a\nhref='truc' />", 'a'],
78 78
 			[[['<a href="1">'], ['<a href="2">']], ['allo <a href="1">', 'allo <a href="2">'], 'a'],
79 79
 			[['<a href="truc">chose</a>'], 'bonjour <a href="truc">chose</a> machin', 'a'],
80 80
 			[
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 			[['<a>chose</a>'], '<a>chose</a>', 'a'],
88 88
 			[[], 'allo <a href="truc">chose</a>', 'b'],
89 89
 			[[], 'allo <a href="truc" />', 'b'],
90
-			[[], 'allo' . "\n" . " <a\nhref='truc' />", 'b'],
90
+			[[], 'allo'."\n"." <a\nhref='truc' />", 'b'],
91 91
 			[[[], []], ['allo <a href="1">', 'allo <a href="2">'], 'b'],
92 92
 			[[], 'bonjour <a href="truc">chose</a> machin', 'b'],
93 93
 			[[], 'bonjour <a href="truc">chose</a> machin <A href="truc">machin</a>', 'b'],
Please login to merge, or discard this patch.
ecrire/tests/Filtre/AttributHtmlTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
 			],
36 36
 			2 => [
37 37
 				'expected' => 'allons &#224; la mer',
38
-				'texte' => 'allons ' . chr(195) . chr(160) . ' la mer', // le a` risque de matcher \s
38
+				'texte' => 'allons '.chr(195).chr(160).' la mer', // le a` risque de matcher \s
39 39
 			],
40 40
 		];
41 41
 	}
Please login to merge, or discard this patch.
ecrire/tests/Sql/SqlSchemaTableTest.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
 	#[Depends('testInsertData')]
64 64
 	public function testMajTimestamp() {
65 65
 		$table = 'spip_test_tintin';
66
-		$where1 = 'id_tintin=' . sql_quote(1);
67
-		$where2 = 'id_tintin=' . sql_quote(2);
66
+		$where1 = 'id_tintin='.sql_quote(1);
67
+		$where2 = 'id_tintin='.sql_quote(2);
68 68
 
69 69
 		// lecture du timestamp actuel
70 70
 		$maj1 = sql_getfetsel('maj', $table, $where1);
@@ -123,17 +123,17 @@  discard block
 block discarded – undo
123 123
 		$this->assertEquals(count($data), sql_count($res), 'sql_count() ne renvoie pas la valeur attendue');
124 124
 
125 125
 		// selection float
126
-		$res = sql_select('*', 'spip_test_tintin', ['un_double>' . sql_quote(3)]);
126
+		$res = sql_select('*', 'spip_test_tintin', ['un_double>'.sql_quote(3)]);
127 127
 		$n = count(array_filter($data, fn ($entry) => $entry['un_double'] > 3));
128 128
 		$this->assertEquals($n, sql_count($res), 'sql_count() ne renvoie pas la valeur attendue sur un float');
129 129
 
130 130
 		// selection REGEXP
131
-		$res = sql_select('*', 'spip_test_tintin', ['un_varchar REGEXP ' . sql_quote('^De')]);
131
+		$res = sql_select('*', 'spip_test_tintin', ['un_varchar REGEXP '.sql_quote('^De')]);
132 132
 		$n = count(array_filter($data, fn ($entry) => str_starts_with($entry['un_varchar'], 'De')));
133 133
 		$this->assertEquals($n, sql_count($res), 'sql_count() ne renvoie pas la valeur attendue sur une REGEXP');
134 134
 
135 135
 		// selection LIKE
136
-		$res = sql_select('*', 'spip_test_tintin', ['un_varchar LIKE ' . sql_quote('De%')]);
136
+		$res = sql_select('*', 'spip_test_tintin', ['un_varchar LIKE '.sql_quote('De%')]);
137 137
 		$this->assertEquals($n, sql_count($res), 'sql_count() ne renvoie pas la valeur attendue sur un LIKE');
138 138
 
139 139
 		// selection array(champs)
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 				'en' => 'Krack',
168 168
 			] as $lg => $res
169 169
 		) {
170
-			$multi = sql_getfetsel(sql_multi('grrrr', $lg), 'spip_test_milou', 'id_milou=' . sql_quote(2));
170
+			$multi = sql_getfetsel(sql_multi('grrrr', $lg), 'spip_test_milou', 'id_milou='.sql_quote(2));
171 171
 			$this->assertEquals($res, $multi, 'sql_multi mal rendu');
172 172
 		}
173 173
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 				'en' => 'Aérieny',
179 179
 			] as $lg => $res
180 180
 		) {
181
-			$multi = sql_getfetsel(sql_multi('alcool', $lg), 'spip_test_haddock', 'id_haddock=' . sql_quote(2));
181
+			$multi = sql_getfetsel(sql_multi('alcool', $lg), 'spip_test_haddock', 'id_haddock='.sql_quote(2));
182 182
 			$this->assertEquals($res, $multi, 'sql_multi avec accents, mal rendu');
183 183
 		}
184 184
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 				'de' => 'Un début de chaine : Vinasse, et [la fin]',
191 191
 			] as $lg => $res
192 192
 		) {
193
-			$multi = sql_getfetsel(sql_multi('alcool', $lg), 'spip_test_haddock', 'id_haddock=' . sql_quote(4));
193
+			$multi = sql_getfetsel(sql_multi('alcool', $lg), 'spip_test_haddock', 'id_haddock='.sql_quote(4));
194 194
 			$this->assertEquals($res, $multi, 'sql_multi avec crochets, mal rendu');
195 195
 		}
196 196
 	}
@@ -291,10 +291,10 @@  discard block
 block discarded – undo
291 291
 				'2.0/2' => (2.0 / 2),
292 292
 				'2/2' => (2 / 2),
293 293
 				'md5(8)' => md5('8'),
294
-				'md5(' . sql_quote('a') . ')' => md5('a'),
294
+				'md5('.sql_quote('a').')' => md5('a'),
295 295
 			] as $func => $expected
296 296
 		) {
297
-			$nb = sql_getfetsel("{$func} AS nb", ['spip_test_tintin'], ['id_tintin=' . sql_quote(1)]);
297
+			$nb = sql_getfetsel("{$func} AS nb", ['spip_test_tintin'], ['id_tintin='.sql_quote(1)]);
298 298
 			$this->assertEquals($expected, $nb, "Selection {$func} en echec");
299 299
 		}
300 300
 	}
@@ -307,11 +307,11 @@  discard block
 block discarded – undo
307 307
 	function testStringFunctions() {
308 308
 		foreach (
309 309
 			[
310
-				'CONCAT(' . sql_quote('cou') . ',' . sql_quote('cou') . ')' => 'coucou',
311
-				'CONCAT(' . sql_quote('cou,') . ',' . sql_quote('cou') . ')' => 'cou,cou',
310
+				'CONCAT('.sql_quote('cou').','.sql_quote('cou').')' => 'coucou',
311
+				'CONCAT('.sql_quote('cou,').','.sql_quote('cou').')' => 'cou,cou',
312 312
 			] as $func => $expected
313 313
 		) {
314
-			$nb = sql_getfetsel("{$func} AS nb", ['spip_test_tintin'], ['id_tintin=' . sql_quote(1)]);
314
+			$nb = sql_getfetsel("{$func} AS nb", ['spip_test_tintin'], ['id_tintin='.sql_quote(1)]);
315 315
 			$this->assertEquals($expected, $nb, "Selection {$func} en echec");
316 316
 		}
317 317
 	}
@@ -339,11 +339,11 @@  discard block
 block discarded – undo
339 339
 	#[Depends('testInsertData')]
340 340
 	public function testUpdateData() {
341 341
 		// ajouter un champ
342
-		$nb = sql_getfetsel('un_bigint', 'spip_test_tintin', 'id_tintin=' . sql_quote(1));
342
+		$nb = sql_getfetsel('un_bigint', 'spip_test_tintin', 'id_tintin='.sql_quote(1));
343 343
 		sql_update('spip_test_tintin', [
344 344
 			'un_bigint' => 'un_bigint+2',
345 345
 		]);
346
-		$nb2 = sql_getfetsel('un_bigint', 'spip_test_tintin', 'id_tintin=' . sql_quote(1));
346
+		$nb2 = sql_getfetsel('un_bigint', 'spip_test_tintin', 'id_tintin='.sql_quote(1));
347 347
 		$this->assertEquals($nb + 2, $nb2, 'sql_update n’a pas fait l’adition !');
348 348
 	}
349 349
 
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 	public function test_delete_data() {
356 356
 		$nb = sql_countsel('spip_test_tintin');
357 357
 		// supprimer une ligne
358
-		sql_delete('spip_test_tintin', 'id_tintin=' . sql_quote(1));
358
+		sql_delete('spip_test_tintin', 'id_tintin='.sql_quote(1));
359 359
 		$this->assertEquals($nb - 1, sql_countsel('spip_test_tintin'), "sql_delete n’a pas supprimé la ligne");
360 360
 
361 361
 		// supprimer tout
Please login to merge, or discard this patch.
ecrire/tests/Xml/XmlHackTest.php 1 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/TemplateTest.php 1 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 1 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.