Merge pull request #3139 from Kdecherf/2502-tag-case

Ignore tag's case
This commit is contained in:
Jérémy Benoist
2017-09-03 20:25:15 +02:00
committed by GitHub
6 changed files with 111 additions and 6 deletions

View File

@ -9,6 +9,7 @@ use Wallabag\CoreBundle\Entity\Tag;
class TagControllerTest extends WallabagCoreTestCase
{
public $tagName = 'opensource';
public $caseTagName = 'OpenSource';
public function testList()
{
@ -36,7 +37,7 @@ class TagControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('form[name=tag]')->form();
$data = [
'tag[label]' => $this->tagName,
'tag[label]' => $this->caseTagName,
];
$client->submit($form, $data);
@ -45,6 +46,7 @@ class TagControllerTest extends WallabagCoreTestCase
// be sure to reload the entry
$entry = $this->getEntityManager()->getRepository(Entry::class)->find($entry->getId());
$this->assertCount(1, $entry->getTags());
$this->assertContains($this->tagName, $entry->getTags());
// tag already exists and already assigned
$client->submit($form, $data);
@ -80,7 +82,7 @@ class TagControllerTest extends WallabagCoreTestCase
$form = $crawler->filter('form[name=tag]')->form();
$data = [
'tag[label]' => 'foo2, bar2',
'tag[label]' => 'foo2, Bar2',
];
$client->submit($form, $data);

View File

@ -125,7 +125,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
$tags = $content->getTags();
$this->assertContains('foot', $tags, 'It includes the "foot" tag');
$this->assertContains('varnish', $tags, 'It includes the "varnish" tag');
$this->assertContains('PHP', $tags, 'It includes the "PHP" tag');
$this->assertContains('php', $tags, 'It includes the "php" tag');
$this->assertSame(3, count($tags));
$this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());

View File

@ -125,7 +125,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$tags = $content->getTags();
$this->assertContains('foot', $tags, 'It includes the "foot" tag');
$this->assertContains('Framabag', $tags, 'It includes the "Framabag" tag');
$this->assertContains('framabag', $tags, 'It includes the "framabag" tag');
$this->assertSame(2, count($tags));
$this->assertInstanceOf(\DateTime::class, $content->getCreatedAt());