From eb1f1ad1772d36db24c6fd74d36f89847e4b1d6b Mon Sep 17 00:00:00 2001 From: Ian Neilson Date: Tue, 10 May 2022 10:07:16 +0000 Subject: [PATCH] Fix count() test error shown by move to PHP7.4 - As of PHP 7.2.0 count() yields a warning on invalid countable types passed to the value parameter. --- tests/doctrine/DoctrineCleanInsert1Test.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/doctrine/DoctrineCleanInsert1Test.php b/tests/doctrine/DoctrineCleanInsert1Test.php index aa5fc6042..f88a254ba 100644 --- a/tests/doctrine/DoctrineCleanInsert1Test.php +++ b/tests/doctrine/DoctrineCleanInsert1Test.php @@ -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)))); }