@@ -48,7 +48,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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'], |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | ], |
| 36 | 36 | 2 => [ |
| 37 | 37 | 'expected' => 'allons à 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 | } |
@@ -63,8 +63,8 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
@@ -15,7 +15,7 @@ |
||
| 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 |
@@ -11,12 +11,12 @@ |
||
| 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 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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); |
@@ -28,7 +28,7 @@ |
||
| 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 { |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $id_document = sql_getfetsel( |
| 51 | 51 | 'id_document', |
| 52 | 52 | 'spip_documents', |
| 53 | - sql_in('mode', ['logoon','logooff','vignette'], 'not'), |
|
| 53 | + sql_in('mode', ['logoon', 'logooff', 'vignette'], 'not'), |
|
| 54 | 54 | orderby: 'rand()', |
| 55 | 55 | limit: '0,1' |
| 56 | 56 | ); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | 'id_article' => -1, |
| 62 | 62 | 'titre' => 'test pour doublons_notes.html', |
| 63 | 63 | 'statut' => 'prepa', |
| 64 | - 'texte' => 'hello [[ xx <doc' . $id_document . '> ]].' |
|
| 64 | + 'texte' => 'hello [[ xx <doc'.$id_document.'> ]].' |
|
| 65 | 65 | ]; |
| 66 | 66 | $id_article = sql_getfetsel('id_article', 'spip_articles', 'id_article = -1'); |
| 67 | 67 | if ($id_article === null) { |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $art = $this->getArticleIdTitle(); |
| 46 | 46 | $contexte = [ |
| 47 | 47 | 'id_article' => $art['id_article'], |
| 48 | - 'like' => $art['starts_with'] . '%', |
|
| 48 | + 'like' => $art['starts_with'].'%', |
|
| 49 | 49 | ]; |
| 50 | 50 | $this->assertOkCode(<<<SPIP |
| 51 | 51 | <BOUCLE_b(ARTICLES){titre like #ENV{like}}{id_article}>ok</BOUCLE_b> |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $art = $this->getArticleIdTitle(); |
| 71 | 71 | $contexte = [ |
| 72 | 72 | 'id_article' => $art['id_article'], |
| 73 | - 'regexp' => '^' . $art['starts_with'], |
|
| 73 | + 'regexp' => '^'.$art['starts_with'], |
|
| 74 | 74 | ]; |
| 75 | 75 | $this->assertOkCode(<<<SPIP |
| 76 | 76 | <BOUCLE_b(ARTICLES){titre == #ENV{regexp}}{id_article}>ok</BOUCLE_b> |