Skip to content

Commit

Permalink
Fix count() test error shown by move to PHP7.4
Browse files Browse the repository at this point in the history
- As of PHP 7.2.0 count() yields a warning on invalid countable types passed to the value parameter.
  • Loading branch information
Ian Neilson authored and gregcorbett committed Oct 12, 2023
1 parent ffd2ec4 commit eb1f1ad
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/doctrine/DoctrineCleanInsert1Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,17 +199,17 @@ public function testShowDoctrineReadFailiureUntilCommitted()
{
print __METHOD__ . "\n";
$n = 1;
// create a new site and persist (but do not flush yet)
// create a new site and persist (but do not flush yet)
$site = TestUtil::createSampleSite('site' . $n/*, 'pk' . $n*/);
$this->em->beginTransaction();
$this->em->persist($site);
// After persist, Doctrine querying does not return our site until we flush, hence we get 0
// returned from our repository.
$this->assertEquals(0, count($this->em->getRepository('Site')->findOneBy(array('shortName' => 'site' . $n))));
// When we flush or commit we get one.
// After persist, Doctrine querying does not return our site until we flush, hence we get 0
// returned from our repository.
$this->assertEquals(0, count($this->em->getRepository('Site')->findBy(array('shortName' => 'site' . $n))));
// When we flush or commit we get one.
$this->em->commit();
$this->em->flush();
$this->assertEquals(1, count($this->em->getRepository('Site')->findOneBy(array('shortName' => 'site' . $n))));
$this->assertEquals(1, count($this->em->getRepository('Site')->findBy(array('shortName' => 'site' . $n))));
}


Expand Down

0 comments on commit eb1f1ad

Please sign in to comment.