aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorJérémy Benoist <j0k3r@users.noreply.github.com>2019-06-06 12:03:37 +0200
committerGitHub <noreply@github.com>2019-06-06 12:03:37 +0200
commitc19845a7ae5fe7c1ff22fd560c48e4af8b9da15a (patch)
tree22a576e9c4329851d965b78581d7258d3fe400c9 /tests
parent2b04b300f83cd4bb288c1fd00e2b77ec4f557a00 (diff)
parentfeb239ea1006685ab3862c988309a1a5a9659559 (diff)
downloadwallabag-c19845a7ae5fe7c1ff22fd560c48e4af8b9da15a.tar.gz
wallabag-c19845a7ae5fe7c1ff22fd560c48e4af8b9da15a.tar.zst
wallabag-c19845a7ae5fe7c1ff22fd560c48e4af8b9da15a.zip
Merge pull request #3959 from wallabag/mig-tag-collation
mysql: change collation of tag label
Diffstat (limited to 'tests')
-rw-r--r--tests/Wallabag/CoreBundle/Controller/TagControllerTest.php46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php b/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php
index be17dcf5..47c83a7b 100644
--- a/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php
+++ b/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php
@@ -221,4 +221,50 @@ class TagControllerTest extends WallabagCoreTestCase
221 $this->assertInstanceOf(Tag::class, $newTag, 'Tag "specific label" exists.'); 221 $this->assertInstanceOf(Tag::class, $newTag, 'Tag "specific label" exists.');
222 $this->assertTrue($newTag->hasEntry($freshEntry), 'Tag "specific label" is assigned to the entry.'); 222 $this->assertTrue($newTag->hasEntry($freshEntry), 'Tag "specific label" is assigned to the entry.');
223 } 223 }
224
225 public function testAddUnicodeTagLabel()
226 {
227 $this->logInAs('admin');
228 $client = $this->getClient();
229
230 $entry = new Entry($this->getLoggedInUser());
231 $entry->setUrl('http://0.0.0.0/tag-caché');
232 $this->getEntityManager()->persist($entry);
233 $this->getEntityManager()->flush();
234 $this->getEntityManager()->clear();
235
236 $crawler = $client->request('GET', '/view/' . $entry->getId());
237
238 $form = $crawler->filter('form[name=tag]')->form();
239
240 $data = [
241 'tag[label]' => 'cache',
242 ];
243
244 $client->submit($form, $data);
245
246 $crawler = $client->request('GET', '/view/' . $entry->getId());
247
248 $form = $crawler->filter('form[name=tag]')->form();
249
250 $data = [
251 'tag[label]' => 'caché',
252 ];
253
254 $client->submit($form, $data);
255
256 $newEntry = $client->getContainer()
257 ->get('doctrine.orm.entity_manager')
258 ->getRepository('WallabagCoreBundle:Entry')
259 ->find($entry->getId());
260
261 $tags = $newEntry->getTags()->toArray();
262 foreach ($tags as $key => $tag) {
263 $tags[$key] = $tag->getLabel();
264 }
265
266 $this->assertGreaterThanOrEqual(2, \count($tags));
267 $this->assertNotFalse(array_search('cache', $tags, true), 'Tag cache is assigned to the entry');
268 $this->assertNotFalse(array_search('caché', $tags, true), 'Tag caché is assigned to the entry');
269 }
224} 270}