From c8de7ab94cb2d8880205c450ebf52d225991df6e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 27 Dec 2016 21:26:53 +0100 Subject: [PATCH] Fixed export by tags with a tag which contains space --- src/Wallabag/CoreBundle/Controller/TagController.php | 2 +- src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php | 2 +- tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php | 4 ++-- tests/Wallabag/CoreBundle/Controller/TagControllerTest.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index 52707cb8..8a093289 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php @@ -143,7 +143,7 @@ class TagController extends Controller 'form' => null, 'entries' => $entries, 'currentPage' => $page, - 'tag' => $tag->getLabel(), + 'tag' => $tag->getSlug(), ]); } } diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php index 09e99f36..6de561e0 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadTagData.php @@ -15,7 +15,7 @@ class LoadTagData extends AbstractFixture implements OrderedFixtureInterface public function load(ObjectManager $manager) { $tag1 = new Tag(); - $tag1->setLabel('foo'); + $tag1->setLabel('foo bar'); $manager->persist($tag1); diff --git a/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php b/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php index 5ca886bd..32a18e26 100644 --- a/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/ExportControllerTest.php @@ -119,7 +119,7 @@ class ExportControllerTest extends WallabagCoreTestCase $this->assertEquals('binary', $headers->get('content-transfer-encoding')); ob_start(); - $crawler = $client->request('GET', '/export/tag_entries.pdf?tag=foo'); + $crawler = $client->request('GET', '/export/tag_entries.pdf?tag=foo-bar'); ob_end_clean(); $this->assertEquals(200, $client->getResponse()->getStatusCode()); @@ -241,7 +241,7 @@ class ExportControllerTest extends WallabagCoreTestCase $this->assertEquals($contentInDB->getLanguage(), $content[0]['language']); $this->assertEquals($contentInDB->getReadingtime(), $content[0]['reading_time']); $this->assertEquals($contentInDB->getDomainname(), $content[0]['domain_name']); - $this->assertEquals(['foo', 'baz'], $content[0]['tags']); + $this->assertEquals(['foo bar', 'baz'], $content[0]['tags']); } public function testXmlExport() diff --git a/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php b/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php index 769ce66e..fa1a3539 100644 --- a/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php @@ -61,7 +61,7 @@ class TagControllerTest extends WallabagCoreTestCase // tag already exists but still not assigned to this entry $data = [ - 'tag[label]' => 'foo', + 'tag[label]' => 'foo bar', ]; $client->submit($form, $data); -- 2.41.0