Skip to content

Commit 5f181e6

Browse files
committed
Use grabNumRecords in seeNumRecords
1 parent ef145f3 commit 5f181e6

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/Codeception/Module/Symfony.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -818,17 +818,7 @@ private function getPossibleKernelClasses()
818818
*/
819819
public function seeNumRecords(int $expectedNum, string $className, array $criteria = [])
820820
{
821-
$em = $this->_getEntityManager();
822-
$repository = $em->getRepository($className);
823-
824-
if (empty($criteria)) {
825-
$currentNum = (int)$repository->createQueryBuilder('a')
826-
->select('count(a.id)')
827-
->getQuery()
828-
->getSingleScalarResult();
829-
} else {
830-
$currentNum = $repository->count($criteria);
831-
}
821+
$currentNum = $this->grabNumRecords($className, $criteria);
832822

833823
$this->assertEquals(
834824
$expectedNum,

0 commit comments

Comments
 (0)