diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2019-01-17 14:28:05 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2019-01-18 15:25:50 +0100 |
commit | 1e0d8ad7b728f6fb2cd886526b0fb84ef803e84f (patch) | |
tree | b4f38bf4a01580f5f7218440e7054688d7178e53 /tests/Wallabag/CoreBundle/Controller | |
parent | 8445ad4790ff4f3f9759f9bfa0d503ad5654e30e (diff) | |
download | wallabag-1e0d8ad7b728f6fb2cd886526b0fb84ef803e84f.tar.gz wallabag-1e0d8ad7b728f6fb2cd886526b0fb84ef803e84f.tar.zst wallabag-1e0d8ad7b728f6fb2cd886526b0fb84ef803e84f.zip |
Enable PHPStan
- Fix error for level 0 & 1 (level 7 has 699 errors...)
- Add `updated_at` to site_credential (so the `timestamps()` method applies correctly)
Diffstat (limited to 'tests/Wallabag/CoreBundle/Controller')
4 files changed, 8 insertions, 9 deletions
diff --git a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php index cf9f1e97..c9dbbaa3 100644 --- a/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php | |||
@@ -1,6 +1,6 @@ | |||
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace tests\Wallabag\CoreBundle\Controller; | 3 | namespace Tests\Wallabag\CoreBundle\Controller; |
4 | 4 | ||
5 | use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; | 5 | use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; |
6 | use Wallabag\AnnotationBundle\Entity\Annotation; | 6 | use Wallabag\AnnotationBundle\Entity\Annotation; |
diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index 006ca330..005296ff 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php | |||
@@ -522,9 +522,12 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
522 | 522 | ||
523 | $crawler = $client->followRedirect(); | 523 | $crawler = $client->followRedirect(); |
524 | 524 | ||
525 | $this->assertGreaterThan(1, $title = $crawler->filter('div[id=article] h1')->extract(['_text'])); | 525 | $title = $crawler->filter('div[id=article] h1')->extract(['_text']); |
526 | $this->assertGreaterThan(1, $title); | ||
526 | $this->assertContains('My updated title hehe :)', $title[0]); | 527 | $this->assertContains('My updated title hehe :)', $title[0]); |
527 | $this->assertSame(1, \count($stats = $crawler->filter('div[class=tools] ul[class=stats] li a[class=tool]')->extract(['_text']))); | 528 | |
529 | $stats = $crawler->filter('div[class=tools] ul[class=stats] li a[class=tool]')->extract(['_text']); | ||
530 | $this->assertCount(1, $stats); | ||
528 | $this->assertNotContains('example.io', trim($stats[0])); | 531 | $this->assertNotContains('example.io', trim($stats[0])); |
529 | } | 532 | } |
530 | 533 | ||
@@ -1327,10 +1330,6 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
1327 | 'http://www.hao123.com/shequ?__noscript__-=1', | 1330 | 'http://www.hao123.com/shequ?__noscript__-=1', |
1328 | 'zh_CN', | 1331 | 'zh_CN', |
1329 | ], | 1332 | ], |
1330 | 'ru' => [ | ||
1331 | 'https://www.kp.ru/daily/26879.7/3921982/', | ||
1332 | 'ru', | ||
1333 | ], | ||
1334 | 'pt_BR' => [ | 1333 | 'pt_BR' => [ |
1335 | 'https://politica.estadao.com.br/noticias/eleicoes,campanha-catatonica,70002491983', | 1334 | 'https://politica.estadao.com.br/noticias/eleicoes,campanha-catatonica,70002491983', |
1336 | 'pt_BR', | 1335 | 'pt_BR', |
diff --git a/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php b/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php index 0c3d4c83..d7ce7c45 100644 --- a/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php | |||
@@ -180,7 +180,7 @@ class ExportControllerTest extends WallabagCoreTestCase | |||
180 | 180 | ||
181 | $this->assertGreaterThan(1, $csv); | 181 | $this->assertGreaterThan(1, $csv); |
182 | // +1 for title line | 182 | // +1 for title line |
183 | $this->assertSame(\count($contentInDB) + 1, \count($csv)); | 183 | $this->assertCount(\count($contentInDB) + 1, $csv); |
184 | $this->assertSame('Title;URL;Content;Tags;"MIME Type";Language;"Creation date"', $csv[0]); | 184 | $this->assertSame('Title;URL;Content;Tags;"MIME Type";Language;"Creation date"', $csv[0]); |
185 | $this->assertContains($contentInDB[0]['title'], $csv[1]); | 185 | $this->assertContains($contentInDB[0]['title'], $csv[1]); |
186 | $this->assertContains($contentInDB[0]['url'], $csv[1]); | 186 | $this->assertContains($contentInDB[0]['url'], $csv[1]); |
diff --git a/tests/Wallabag/CoreBundle/Controller/RssControllerTest.php b/tests/Wallabag/CoreBundle/Controller/RssControllerTest.php index 2af6e14f..afa90621 100644 --- a/tests/Wallabag/CoreBundle/Controller/RssControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/RssControllerTest.php | |||
@@ -11,7 +11,7 @@ class RssControllerTest extends WallabagCoreTestCase | |||
11 | $doc = new \DOMDocument(); | 11 | $doc = new \DOMDocument(); |
12 | $doc->loadXML($xml); | 12 | $doc->loadXML($xml); |
13 | 13 | ||
14 | $xpath = new \DOMXpath($doc); | 14 | $xpath = new \DOMXPath($doc); |
15 | 15 | ||
16 | if (null === $nb) { | 16 | if (null === $nb) { |
17 | $this->assertGreaterThan(0, $xpath->query('//item')->length); | 17 | $this->assertGreaterThan(0, $xpath->query('//item')->length); |