From: Kevin Decherf Date: Sun, 19 Nov 2017 14:26:13 +0000 (+0100) Subject: Fix phpcs X-Git-Tag: 2.3.0~19^2 X-Git-Url: https://git.immae.eu/?p=github%2Fwallabag%2Fwallabag.git;a=commitdiff_plain;h=eae8138b33e4ed4a5d1a98daf77941ef691629de Fix phpcs Signed-off-by: Kevin Decherf --- diff --git a/app/DoctrineMigrations/Version20171105202000.php b/app/DoctrineMigrations/Version20171105202000.php index b1cff9ce..3769045f 100644 --- a/app/DoctrineMigrations/Version20171105202000.php +++ b/app/DoctrineMigrations/Version20171105202000.php @@ -8,7 +8,7 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** - * Add origin_url column + * Add origin_url column. */ class Version20171105202000 extends AbstractMigration implements ContainerAwareInterface { diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 445cc45e..2b1f2e05 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -840,7 +840,7 @@ class Entry return $this; } - + /** * Set origin url. * @@ -854,7 +854,7 @@ class Entry return $this; } - + /** * Get origin url. * diff --git a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php index 8f0effee..65a3ccd9 100644 --- a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php +++ b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php @@ -712,28 +712,28 @@ class EntryRestControllerTest extends WallabagApiTestCase $this->assertSame($previousLanguage, $content['language'], 'Ensure language has not moved'); $this->assertSame($previousTitle, $content['title'], 'Ensure title has not moved'); } - - public function testPatchEntryNullOriginUrl() - { - $entry = $this->client->getContainer() + + public function testPatchEntryNullOriginUrl() + { + $entry = $this->client->getContainer() ->get('doctrine.orm.entity_manager') ->getRepository('WallabagCoreBundle:Entry') ->findOneByUser(1); - - if (!$entry) { - $this->markTestSkipped('No content found in db.'); - } - - $this->client->request('PATCH', '/api/entries/' . $entry->getId() . '.json', [ + + if (!$entry) { + $this->markTestSkipped('No content found in db.'); + } + + $this->client->request('PATCH', '/api/entries/' . $entry->getId() . '.json', [ 'origin_url' => null, ]); - - $this->assertSame(200, $this->client->getResponse()->getStatusCode()); - - $content = json_decode($this->client->getResponse()->getContent(), true); - - $this->assertNull($content['origin_url']); - } + + $this->assertSame(200, $this->client->getResponse()->getStatusCode()); + + $content = json_decode($this->client->getResponse()->getContent(), true); + + $this->assertNull($content['origin_url']); + } public function testGetTagsEntry() { diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index e2fb8d78..c6a523e3 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php @@ -519,7 +519,7 @@ class EntryControllerTest extends WallabagCoreTestCase $this->assertGreaterThan(1, $title = $crawler->filter('div[id=article] h1')->extract(['_text'])); $this->assertContains('My updated title hehe :)', $title[0]); - $this->assertSame(1, sizeof($stats = $crawler->filter('div[class=tools] ul[class=stats] li a[class=tool]')->extract(['_text']))); + $this->assertSame(1, count($stats = $crawler->filter('div[class=tools] ul[class=stats] li a[class=tool]')->extract(['_text']))); $this->assertNotContains('example.io', trim($stats[0])); } diff --git a/tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php b/tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php index 27989346..82336060 100644 --- a/tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php +++ b/tests/Wallabag/CoreBundle/Twig/WallabagExtensionTest.php @@ -50,7 +50,7 @@ class WallabagExtensionTest extends \PHPUnit_Framework_TestCase ->getMock(); $extension = new WallabagExtension($entryRepository, $tagRepository, $tokenStorage, 0, $translator); - + $this->assertSame('lemonde.fr', $extension->removeSchemeAndWww('www.lemonde.fr')); $this->assertSame('lemonde.fr', $extension->removeSchemeAndWww('http://lemonde.fr')); $this->assertSame('lemonde.fr', $extension->removeSchemeAndWww('https://www.lemonde.fr'));