Skip to content

Commit

Permalink
meta: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Simperfit committed Jun 5, 2019
1 parent ea265dd commit 477fbe0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions tests/Test/WebTestCaseConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* annotation:
*
* @IgnoreAnnotation("expectedException")
* @IgnoreAnnotation("DisableDatabaseCache")
*/
class WebTestCaseConfigTest extends WebTestCase
{
Expand Down
23 changes: 12 additions & 11 deletions tests/Test/WebTestCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
/**
* @IgnoreAnnotation("depends")
* @IgnoreAnnotation("expectedException")
* @IgnoreAnnotation("DisableDatabaseCache")
*/
class WebTestCaseTest extends WebTestCase
{
Expand Down Expand Up @@ -326,7 +327,7 @@ public function testLoadFixtures(): void
$this->assertTrue($user1->getEnabled());

// Load data from database
$em = $this->client->getContainer()
$em = self::$client->getContainer()
->get('doctrine.orm.entity_manager');

$users = $em->getRepository('LiipFunctionalTestBundle:User')
Expand Down Expand Up @@ -414,7 +415,7 @@ public function testLoadDependentFixtures(): void
$fixtures
);

$em = $this->client->getContainer()
$em = self::$client->getContainer()
->get('doctrine.orm.entity_manager');

$users = $em->getRepository('LiipFunctionalTestBundle:User')
Expand All @@ -441,7 +442,7 @@ public function testLoadDependentFixturesWithDependencyInjected(): void
$fixtures
);

$em = $this->client->getContainer()
$em = self::$client->getContainer()
->get('doctrine.orm.entity_manager');

$users = $em->getRepository('LiipFunctionalTestBundle:User')
Expand Down Expand Up @@ -474,7 +475,7 @@ public function testLoadFixturesFiles(): void
$fixtures
);

$em = $this->client->getContainer()
$em = self::$client->getContainer()
->get('doctrine.orm.entity_manager');

$users = $em->getRepository('LiipFunctionalTestBundle:User')
Expand Down Expand Up @@ -552,7 +553,7 @@ public function testLoadFixturesFilesWithPurgeModeTruncate(): void
public function testLoadFixturesFilesPaths(): void
{
$fixtures = $this->loadFixtureFiles([
$this->client->getContainer()->get('kernel')->locateResource(
self::$client->getContainer()->get('kernel')->locateResource(
'@AcmeBundle/DataFixtures/ORM/user.yml'
),
]);
Expand All @@ -574,7 +575,7 @@ public function testLoadFixturesFilesPaths(): void
$this->assertInternalType('string', $user1->getUsername());
$this->assertTrue($user1->getEnabled());

$em = $this->client->getContainer()
$em = self::$client->getContainer()
->get('doctrine.orm.entity_manager');

$users = $em->getRepository('LiipFunctionalTestBundle:User')
Expand Down Expand Up @@ -616,7 +617,7 @@ public function testLoadFixturesFilesPathsWithoutLocateResource(): void
$fixtures
);

$em = $this->client->getContainer()
$em = self::$client->getContainer()
->get('doctrine.orm.entity_manager');

$users = $em->getRepository('LiipFunctionalTestBundle:User')
Expand Down Expand Up @@ -652,14 +653,14 @@ public function testUserWithFixtures(): void

$path = '/user/1';

$this->client->enableProfiler();
self::$client->enableProfiler();

/** @var \Symfony\Component\DomCrawler\Crawler $crawler */
$crawler = $this->client->request('GET', $path);
$crawler = self::$client->request('GET', $path);

$this->assertStatusCode(200, $this->client);
$this->assertStatusCode(200, self::$client);

if ($profile = $this->client->getProfile()) {
if ($profile = self::$client->getProfile()) {
// One query
$this->assertSame(1,
$profile->getCollector('db')->getQueryCount());
Expand Down

0 comments on commit 477fbe0

Please sign in to comment.