Skip to content

Commit 9bcebcf

Browse files
Count how many users were inserted in database
1 parent 8a12f2b commit 9bcebcf

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/Test/WebTestCaseConfigMysqlTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
namespace Liip\FunctionalTestBundle\Tests\Test;
1515

16+
use Doctrine\Common\DataFixtures\Purger\ORMPurger;
1617
use Liip\FunctionalTestBundle\Test\WebTestCase;
1718
use Liip\FunctionalTestBundle\Tests\AppConfigMysql\AppConfigMysqlKernel;
1819

@@ -121,12 +122,23 @@ public function testAppendFixtures(): void
121122
$em = $this->getContainer()
122123
->get('doctrine.orm.entity_manager');
123124

125+
$users = $em->getRepository('LiipFunctionalTestBundle:User')
126+
->findAll();
127+
128+
// Check that there are 3 users.
129+
$this->assertCount(
130+
3,
131+
$users
132+
);
133+
124134
/** @var \Liip\FunctionalTestBundle\Tests\App\Entity\User $user */
125135
$user1 = $em->getRepository('LiipFunctionalTestBundle:User')
126136
->findOneBy([
127137
'id' => 1,
128138
]);
129139

140+
$this->assertNotNull($user1);
141+
130142
$this->assertSame(
131143
'foo@bar.com',
132144
$user1->getEmail()

0 commit comments

Comments
 (0)