aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Tests
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-11-09 16:31:59 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-11-09 16:31:59 +0100
commitf1eccfd63f214dcc730ab0d18a694a5465f425db (patch)
treee6cbd355f3a360e5619821fb1415ee26a01f11ce /src/Wallabag/CoreBundle/Tests
parent4529d0f4b6b20cbbd1ccb5339a753aff7d35552b (diff)
parent53cf5106891fc64f3f66cb6b3316654a9620239c (diff)
downloadwallabag-f1eccfd63f214dcc730ab0d18a694a5465f425db.tar.gz
wallabag-f1eccfd63f214dcc730ab0d18a694a5465f425db.tar.zst
wallabag-f1eccfd63f214dcc730ab0d18a694a5465f425db.zip
Merge pull request #1500 from wallabag/v2-quote-pgsql
Fix quote strategy for reserved keyword in Postgres
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests')
-rw-r--r--src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php63
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php6
-rw-r--r--src/Wallabag/CoreBundle/Tests/EventListener/LocaleListenerTest.php3
-rw-r--r--src/Wallabag/CoreBundle/Tests/EventListener/RegistrationConfirmedListenerTest.php3
-rw-r--r--src/Wallabag/CoreBundle/Tests/EventListener/UserLocaleListenerTest.php3
-rw-r--r--src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php3
-rw-r--r--src/Wallabag/CoreBundle/Tests/ParamConverter/UsernameRssTokenConverterTest.php3
-rw-r--r--src/Wallabag/CoreBundle/Tests/Subscriber/TablePrefixSubscriberTest.php114
-rw-r--r--src/Wallabag/CoreBundle/Tests/WallabagCoreTestCase.php2
9 files changed, 161 insertions, 39 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php b/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php
index e98dd202..c9346040 100644
--- a/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php
@@ -28,9 +28,7 @@ class InstallCommandTest extends WallabagCoreTestCase
28 28
29 public function testRunInstallCommand() 29 public function testRunInstallCommand()
30 { 30 {
31 $this->container = static::$kernel->getContainer(); 31 $application = new Application($this->getClient()->getKernel());
32
33 $application = new Application(static::$kernel);
34 $application->add(new InstallCommandMock()); 32 $application->add(new InstallCommandMock());
35 33
36 $command = $application->find('wallabag:install'); 34 $command = $application->find('wallabag:install');
@@ -59,9 +57,7 @@ class InstallCommandTest extends WallabagCoreTestCase
59 57
60 public function testRunInstallCommandWithReset() 58 public function testRunInstallCommandWithReset()
61 { 59 {
62 $this->container = static::$kernel->getContainer(); 60 $application = new Application($this->getClient()->getKernel());
63
64 $application = new Application(static::$kernel);
65 $application->add(new InstallCommandMock()); 61 $application->add(new InstallCommandMock());
66 62
67 $command = $application->find('wallabag:install'); 63 $command = $application->find('wallabag:install');
@@ -89,28 +85,39 @@ class InstallCommandTest extends WallabagCoreTestCase
89 $this->assertContains('Step 4 of 4. Installing assets.', $tester->getDisplay()); 85 $this->assertContains('Step 4 of 4. Installing assets.', $tester->getDisplay());
90 86
91 // we force to reset everything 87 // we force to reset everything
92 $this->assertContains('Droping database, creating database and schema', $tester->getDisplay()); 88 $this->assertContains('Droping database, creating database and schema, clearing the cache', $tester->getDisplay());
93 } 89 }
94 90
95 /**
96 * @group command-doctrine
97 */
98 public function testRunInstallCommandWithDatabaseRemoved() 91 public function testRunInstallCommandWithDatabaseRemoved()
99 { 92 {
100 $this->container = static::$kernel->getContainer(); 93 if ($this->getClient()->getContainer()->get('doctrine')->getConnection()->getDriver() instanceof \Doctrine\DBAL\Driver\PDOPgSql\Driver) {
101 94 /*
102 $application = new Application(static::$kernel); 95 * LOG: statement: CREATE DATABASE "wallabag"
103 $application->add(new InstallCommand()); 96 * ERROR: source database "template1" is being accessed by other users
97 * DETAIL: There is 1 other session using the database.
98 * STATEMENT: CREATE DATABASE "wallabag"
99 * FATAL: database "wallabag" does not exist
100 *
101 * http://stackoverflow.com/a/14374832/569101
102 */
103 $this->markTestSkipped('PostgreSQL spotted: can find a good way to drop current database, skipping.');
104 }
105
106 $application = new Application($this->getClient()->getKernel());
104 $application->add(new DropDatabaseDoctrineCommand()); 107 $application->add(new DropDatabaseDoctrineCommand());
105 108
106 // drop database first, so the install command won't ask to reset things 109 // drop database first, so the install command won't ask to reset things
107 $command = new DropDatabaseDoctrineCommand(); 110 $command = $application->find('doctrine:database:drop');
108 $command->setApplication($application);
109 $command->run(new ArrayInput(array( 111 $command->run(new ArrayInput(array(
110 'command' => 'doctrine:database:drop', 112 'command' => 'doctrine:database:drop',
111 '--force' => true, 113 '--force' => true,
112 )), new NullOutput()); 114 )), new NullOutput());
113 115
116 // start a new application to avoid lagging connexion to pgsql
117 $client = static::createClient();
118 $application = new Application($client->getKernel());
119 $application->add(new InstallCommand());
120
114 $command = $application->find('wallabag:install'); 121 $command = $application->find('wallabag:install');
115 122
116 // We mock the QuestionHelper 123 // We mock the QuestionHelper
@@ -140,9 +147,7 @@ class InstallCommandTest extends WallabagCoreTestCase
140 147
141 public function testRunInstallCommandChooseResetSchema() 148 public function testRunInstallCommandChooseResetSchema()
142 { 149 {
143 $this->container = static::$kernel->getContainer(); 150 $application = new Application($this->getClient()->getKernel());
144
145 $application = new Application(static::$kernel);
146 $application->add(new InstallCommandMock()); 151 $application->add(new InstallCommandMock());
147 152
148 $command = $application->find('wallabag:install'); 153 $command = $application->find('wallabag:install');
@@ -176,14 +181,16 @@ class InstallCommandTest extends WallabagCoreTestCase
176 $this->assertContains('Droping schema and creating schema', $tester->getDisplay()); 181 $this->assertContains('Droping schema and creating schema', $tester->getDisplay());
177 } 182 }
178 183
179 /**
180 * @group command-doctrine
181 */
182 public function testRunInstallCommandChooseNothing() 184 public function testRunInstallCommandChooseNothing()
183 { 185 {
184 $this->container = static::$kernel->getContainer(); 186 if ($this->getClient()->getContainer()->get('doctrine')->getConnection()->getDriver() instanceof \Doctrine\DBAL\Driver\PDOPgSql\Driver) {
185 187 /*
186 $application = new Application(static::$kernel); 188 * @see testRunInstallCommandWithDatabaseRemoved
189 */
190 $this->markTestSkipped('PostgreSQL spotted: can find a good way to drop current database, skipping.');
191 }
192
193 $application = new Application($this->getClient()->getKernel());
187 $application->add(new InstallCommand()); 194 $application->add(new InstallCommand());
188 $application->add(new DropDatabaseDoctrineCommand()); 195 $application->add(new DropDatabaseDoctrineCommand());
189 $application->add(new CreateDatabaseDoctrineCommand()); 196 $application->add(new CreateDatabaseDoctrineCommand());
@@ -196,7 +203,7 @@ class InstallCommandTest extends WallabagCoreTestCase
196 '--force' => true, 203 '--force' => true,
197 )), new NullOutput()); 204 )), new NullOutput());
198 205
199 $this->container->get('doctrine')->getManager()->getConnection()->close(); 206 $this->getClient()->getContainer()->get('doctrine')->getConnection()->close();
200 207
201 $command = new CreateDatabaseDoctrineCommand(); 208 $command = new CreateDatabaseDoctrineCommand();
202 $command->setApplication($application); 209 $command->setApplication($application);
@@ -237,9 +244,7 @@ class InstallCommandTest extends WallabagCoreTestCase
237 244
238 public function testRunInstallCommandNoInteraction() 245 public function testRunInstallCommandNoInteraction()
239 { 246 {
240 $this->container = static::$kernel->getContainer(); 247 $application = new Application($this->getClient()->getKernel());
241
242 $application = new Application(static::$kernel);
243 $application->add(new InstallCommandMock()); 248 $application->add(new InstallCommandMock());
244 249
245 $command = $application->find('wallabag:install'); 250 $command = $application->find('wallabag:install');
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
index 5ac39d12..56b4c9e4 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/EntryControllerTest.php
@@ -74,6 +74,9 @@ class EntryControllerTest extends WallabagCoreTestCase
74 $this->assertEquals('This value should not be blank.', $alert[0]); 74 $this->assertEquals('This value should not be blank.', $alert[0]);
75 } 75 }
76 76
77 /**
78 * This test will require an internet connection.
79 */
77 public function testPostNewOk() 80 public function testPostNewOk()
78 { 81 {
79 $this->logInAs('admin'); 82 $this->logInAs('admin');
@@ -119,6 +122,9 @@ class EntryControllerTest extends WallabagCoreTestCase
119 $this->assertEquals(200, $client->getResponse()->getStatusCode()); 122 $this->assertEquals(200, $client->getResponse()->getStatusCode());
120 } 123 }
121 124
125 /**
126 * @depends testPostNewOk
127 */
122 public function testView() 128 public function testView()
123 { 129 {
124 $this->logInAs('admin'); 130 $this->logInAs('admin');
diff --git a/src/Wallabag/CoreBundle/Tests/EventListener/LocaleListenerTest.php b/src/Wallabag/CoreBundle/Tests/EventListener/LocaleListenerTest.php
index 356a411e..d89bee04 100644
--- a/src/Wallabag/CoreBundle/Tests/EventListener/LocaleListenerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/EventListener/LocaleListenerTest.php
@@ -2,7 +2,6 @@
2 2
3namespace Wallabag\CoreBundle\Tests\EventListener; 3namespace Wallabag\CoreBundle\Tests\EventListener;
4 4
5use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
6use Symfony\Component\EventDispatcher\EventDispatcher; 5use Symfony\Component\EventDispatcher\EventDispatcher;
7use Symfony\Component\HttpFoundation\Request; 6use Symfony\Component\HttpFoundation\Request;
8use Symfony\Component\HttpKernel\KernelEvents; 7use Symfony\Component\HttpKernel\KernelEvents;
@@ -12,7 +11,7 @@ use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
12use Symfony\Component\HttpFoundation\Session\Session; 11use Symfony\Component\HttpFoundation\Session\Session;
13use Wallabag\CoreBundle\EventListener\LocaleListener; 12use Wallabag\CoreBundle\EventListener\LocaleListener;
14 13
15class LocaleListenerTest extends KernelTestCase 14class LocaleListenerTest extends \PHPUnit_Framework_TestCase
16{ 15{
17 private function getEvent(Request $request) 16 private function getEvent(Request $request)
18 { 17 {
diff --git a/src/Wallabag/CoreBundle/Tests/EventListener/RegistrationConfirmedListenerTest.php b/src/Wallabag/CoreBundle/Tests/EventListener/RegistrationConfirmedListenerTest.php
index df94fad2..31283399 100644
--- a/src/Wallabag/CoreBundle/Tests/EventListener/RegistrationConfirmedListenerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/EventListener/RegistrationConfirmedListenerTest.php
@@ -2,7 +2,6 @@
2 2
3namespace Wallabag\CoreBundle\Tests\EventListener; 3namespace Wallabag\CoreBundle\Tests\EventListener;
4 4
5use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
6use Symfony\Component\EventDispatcher\EventDispatcher; 5use Symfony\Component\EventDispatcher\EventDispatcher;
7use Symfony\Component\HttpFoundation\Request; 6use Symfony\Component\HttpFoundation\Request;
8use Symfony\Component\HttpFoundation\Response; 7use Symfony\Component\HttpFoundation\Response;
@@ -12,7 +11,7 @@ use Wallabag\CoreBundle\EventListener\RegistrationConfirmedListener;
12use Wallabag\CoreBundle\Entity\Config; 11use Wallabag\CoreBundle\Entity\Config;
13use Wallabag\UserBundle\Entity\User; 12use Wallabag\UserBundle\Entity\User;
14 13
15class RegistrationConfirmedListenerTest extends KernelTestCase 14class RegistrationConfirmedListenerTest extends \PHPUnit_Framework_TestCase
16{ 15{
17 private $em; 16 private $em;
18 private $listener; 17 private $listener;
diff --git a/src/Wallabag/CoreBundle/Tests/EventListener/UserLocaleListenerTest.php b/src/Wallabag/CoreBundle/Tests/EventListener/UserLocaleListenerTest.php
index e8a65fbf..80ddb457 100644
--- a/src/Wallabag/CoreBundle/Tests/EventListener/UserLocaleListenerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/EventListener/UserLocaleListenerTest.php
@@ -2,7 +2,6 @@
2 2
3namespace Wallabag\CoreBundle\Tests\EventListener; 3namespace Wallabag\CoreBundle\Tests\EventListener;
4 4
5use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
6use Symfony\Component\HttpFoundation\Request; 5use Symfony\Component\HttpFoundation\Request;
7use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; 6use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
8use Symfony\Component\HttpFoundation\Session\Session; 7use Symfony\Component\HttpFoundation\Session\Session;
@@ -12,7 +11,7 @@ use Wallabag\CoreBundle\EventListener\UserLocaleListener;
12use Wallabag\CoreBundle\Entity\Config; 11use Wallabag\CoreBundle\Entity\Config;
13use Wallabag\UserBundle\Entity\User; 12use Wallabag\UserBundle\Entity\User;
14 13
15class UserLocaleListenerTest extends KernelTestCase 14class UserLocaleListenerTest extends \PHPUnit_Framework_TestCase
16{ 15{
17 public function testWithLanguage() 16 public function testWithLanguage()
18 { 17 {
diff --git a/src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php b/src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php
index 1d0d4062..4bce4708 100644
--- a/src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Helper/ContentProxyTest.php
@@ -2,12 +2,11 @@
2 2
3namespace Wallabag\CoreBundle\Tests\Helper; 3namespace Wallabag\CoreBundle\Tests\Helper;
4 4
5use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
6use Wallabag\CoreBundle\Entity\Entry; 5use Wallabag\CoreBundle\Entity\Entry;
7use Wallabag\UserBundle\Entity\User; 6use Wallabag\UserBundle\Entity\User;
8use Wallabag\CoreBundle\Helper\ContentProxy; 7use Wallabag\CoreBundle\Helper\ContentProxy;
9 8
10class ContentProxyTest extends KernelTestCase 9class ContentProxyTest extends \PHPUnit_Framework_TestCase
11{ 10{
12 public function testWithEmptyContent() 11 public function testWithEmptyContent()
13 { 12 {
diff --git a/src/Wallabag/CoreBundle/Tests/ParamConverter/UsernameRssTokenConverterTest.php b/src/Wallabag/CoreBundle/Tests/ParamConverter/UsernameRssTokenConverterTest.php
index e28dc4ba..1c9a4ad7 100644
--- a/src/Wallabag/CoreBundle/Tests/ParamConverter/UsernameRssTokenConverterTest.php
+++ b/src/Wallabag/CoreBundle/Tests/ParamConverter/UsernameRssTokenConverterTest.php
@@ -2,13 +2,12 @@
2 2
3namespace Wallabag\CoreBundle\Tests\Command; 3namespace Wallabag\CoreBundle\Tests\Command;
4 4
5use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
6use Wallabag\CoreBundle\ParamConverter\UsernameRssTokenConverter; 5use Wallabag\CoreBundle\ParamConverter\UsernameRssTokenConverter;
7use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; 6use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
8use Symfony\Component\HttpFoundation\Request; 7use Symfony\Component\HttpFoundation\Request;
9use Wallabag\UserBundle\Entity\User; 8use Wallabag\UserBundle\Entity\User;
10 9
11class UsernameRssTokenConverterTest extends KernelTestCase 10class UsernameRssTokenConverterTest extends \PHPUnit_Framework_TestCase
12{ 11{
13 public function testSupportsWithNoRegistry() 12 public function testSupportsWithNoRegistry()
14 { 13 {
diff --git a/src/Wallabag/CoreBundle/Tests/Subscriber/TablePrefixSubscriberTest.php b/src/Wallabag/CoreBundle/Tests/Subscriber/TablePrefixSubscriberTest.php
new file mode 100644
index 00000000..a26ff436
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Tests/Subscriber/TablePrefixSubscriberTest.php
@@ -0,0 +1,114 @@
1<?php
2
3namespace Wallabag\CoreBundle\Tests\Subscriber;
4
5use Doctrine\ORM\Mapping\ClassMetadata;
6use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
7use Doctrine\Common\EventManager;
8use Wallabag\CoreBundle\Subscriber\TablePrefixSubscriber;
9
10class TablePrefixSubscriberTest extends \PHPUnit_Framework_TestCase
11{
12 public function dataForPrefix()
13 {
14 return array(
15 array('wallabag_', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'wallabag_user', '"wallabag_user"', new \Doctrine\DBAL\Platforms\PostgreSqlPlatform()),
16 array('wallabag_', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'wallabag_user', '`wallabag_user`', new \Doctrine\DBAL\Platforms\MySqlPlatform()),
17 array('wallabag_', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'wallabag_user', '"wallabag_user"', new \Doctrine\DBAL\Platforms\SqlitePlatform()),
18
19 array('wallabag_', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'wallabag_user', 'wallabag_user', new \Doctrine\DBAL\Platforms\PostgreSqlPlatform()),
20 array('wallabag_', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'wallabag_user', 'wallabag_user', new \Doctrine\DBAL\Platforms\MySqlPlatform()),
21 array('wallabag_', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'wallabag_user', 'wallabag_user', new \Doctrine\DBAL\Platforms\SqlitePlatform()),
22
23 array('', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'user', '"user"', new \Doctrine\DBAL\Platforms\PostgreSqlPlatform()),
24 array('', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'user', '`user`', new \Doctrine\DBAL\Platforms\MySqlPlatform()),
25 array('', 'Wallabag\UserBundle\Entity\User', '`user`', 'user', 'user', '"user"', new \Doctrine\DBAL\Platforms\SqlitePlatform()),
26
27 array('', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'user', 'user', new \Doctrine\DBAL\Platforms\PostgreSqlPlatform()),
28 array('', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'user', 'user', new \Doctrine\DBAL\Platforms\MySqlPlatform()),
29 array('', 'Wallabag\UserBundle\Entity\User', 'user', 'user', 'user', 'user', new \Doctrine\DBAL\Platforms\SqlitePlatform()),
30 );
31 }
32
33 /**
34 * @dataProvider dataForPrefix
35 */
36 public function testPrefix($prefix, $entityName, $tableName, $tableNameExpected, $finalTableName, $finalTableNameQuoted, $platform)
37 {
38 $em = $this->getMockBuilder('Doctrine\ORM\EntityManager')
39 ->disableOriginalConstructor()
40 ->getMock();
41
42 $subscriber = new TablePrefixSubscriber($prefix);
43
44 $metaClass = new ClassMetadata($entityName);
45 $metaClass->setPrimaryTable(array('name' => $tableName));
46
47 $metaDataEvent = new LoadClassMetadataEventArgs($metaClass, $em);
48
49 $this->assertEquals($tableNameExpected, $metaDataEvent->getClassMetadata()->getTableName());
50
51 $subscriber->loadClassMetadata($metaDataEvent);
52
53 $this->assertEquals($finalTableName, $metaDataEvent->getClassMetadata()->getTableName());
54 $this->assertEquals($finalTableNameQuoted, $metaDataEvent->getClassMetadata()->getQuotedTableName($platform));
55 }
56
57 /**
58 * @dataProvider dataForPrefix
59 */
60 public function testSubscribedEvents($prefix, $entityName, $tableName, $tableNameExpected, $finalTableName, $finalTableNameQuoted, $platform)
61 {
62 $em = $this->getMockBuilder('Doctrine\ORM\EntityManager')
63 ->disableOriginalConstructor()
64 ->getMock();
65
66 $metaClass = new ClassMetadata($entityName);
67 $metaClass->setPrimaryTable(array('name' => $tableName));
68
69 $metaDataEvent = new LoadClassMetadataEventArgs($metaClass, $em);
70
71 $subscriber = new TablePrefixSubscriber($prefix);
72
73 $evm = new EventManager();
74 $evm->addEventSubscriber($subscriber);
75
76 $evm->dispatchEvent('loadClassMetadata', $metaDataEvent);
77
78 $this->assertEquals($finalTableName, $metaDataEvent->getClassMetadata()->getTableName());
79 $this->assertEquals($finalTableNameQuoted, $metaDataEvent->getClassMetadata()->getQuotedTableName($platform));
80 }
81
82 public function testPrefixManyToMany()
83 {
84 $em = $this->getMockBuilder('Doctrine\ORM\EntityManager')
85 ->disableOriginalConstructor()
86 ->getMock();
87
88 $subscriber = new TablePrefixSubscriber('yo_');
89
90 $metaClass = new ClassMetadata('Wallabag\UserBundle\Entity\Entry');
91 $metaClass->setPrimaryTable(array('name' => 'entry'));
92 $metaClass->mapManyToMany(array(
93 'fieldName' => 'tags',
94 'joinTable' => array('name' => null, 'schema' => null),
95 'targetEntity' => 'Tag',
96 'mappedBy' => null,
97 'inversedBy' => 'entries',
98 'cascade' => array('persist'),
99 'indexBy' => null,
100 'orphanRemoval' => false,
101 'fetch' => 2,
102 ));
103
104 $metaDataEvent = new LoadClassMetadataEventArgs($metaClass, $em);
105
106 $this->assertEquals('entry', $metaDataEvent->getClassMetadata()->getTableName());
107
108 $subscriber->loadClassMetadata($metaDataEvent);
109
110 $this->assertEquals('yo_entry', $metaDataEvent->getClassMetadata()->getTableName());
111 $this->assertEquals('yo_entry_tag', $metaDataEvent->getClassMetadata()->associationMappings['tags']['joinTable']['name']);
112 $this->assertEquals('yo_entry', $metaDataEvent->getClassMetadata()->getQuotedTableName(new \Doctrine\DBAL\Platforms\MySqlPlatform()));
113 }
114}
diff --git a/src/Wallabag/CoreBundle/Tests/WallabagCoreTestCase.php b/src/Wallabag/CoreBundle/Tests/WallabagCoreTestCase.php
index e5096528..ce3cabe8 100644
--- a/src/Wallabag/CoreBundle/Tests/WallabagCoreTestCase.php
+++ b/src/Wallabag/CoreBundle/Tests/WallabagCoreTestCase.php
@@ -15,6 +15,8 @@ abstract class WallabagCoreTestCase extends WebTestCase
15 15
16 public function setUp() 16 public function setUp()
17 { 17 {
18 parent::setUp();
19
18 $this->client = static::createClient(); 20 $this->client = static::createClient();
19 } 21 }
20 22