private function countProphecyAssertions()
 {
     $this->prophecyAssertionsCounted = true;
     foreach ($this->prophet->getProphecies() as $objectProphecy) {
         foreach ($objectProphecy->getMethodProphecies() as $methodProphecies) {
             foreach ($methodProphecies as $methodProphecy) {
                 $this->addToAssertionCount(count($methodProphecy->getCheckedPredictions()));
             }
         }
     }
 }
 /**
  * {@inheritdoc}
  */
 protected function verifyMockObjects()
 {
     parent::verifyMockObjects();
     if ($this->prophet !== null) {
         try {
             $this->prophet->checkPredictions();
         } catch (\Exception $e) {
             /** Intentionally left empty */
         }
         foreach ($this->prophet->getProphecies() as $objectProphecy) {
             foreach ($objectProphecy->getMethodProphecies() as $methodProphecies) {
                 foreach ($methodProphecies as $methodProphecy) {
                     $this->addToAssertionCount(count($methodProphecy->getCheckedPredictions()));
                 }
             }
         }
         if (isset($e)) {
             throw $e;
         }
     }
 }
示例#3
0
 /**
  * Verifies the mock object expectations.
  *
  * @since Method available since Release 3.5.0
  */
 protected function verifyMockObjects()
 {
     foreach ($this->mockObjects as $mockObject) {
         if ($mockObject->__phpunit_hasMatchers()) {
             $this->numAssertions++;
         }
         $mockObject->__phpunit_verify();
     }
     if ($this->prophet !== null) {
         try {
             $this->prophet->checkPredictions();
         } catch (Exception $e) {
             /** Intentionally left empty */
         }
         foreach ($this->prophet->getProphecies() as $objectProphecy) {
             foreach ($objectProphecy->getMethodProphecies() as $methodProphecies) {
                 foreach ($methodProphecies as $methodProphecy) {
                     $this->numAssertions += count($methodProphecy->getCheckedPredictions());
                 }
             }
         }
         if (isset($e)) {
             throw $e;
         }
     }
 }
示例#4
0
 /**
  * Verifies the mock object expectations.
  *
  * @since Method available since Release 3.5.0
  */
 protected function verifyMockObjects()
 {
     foreach ($this->mockObjects as $mockObject) {
         if ($mockObject->__phpunit_hasMatchers()) {
             $this->numAssertions++;
         }
         $mockObject->__phpunit_verify();
     }
     if ($this->prophet !== null) {
         foreach ($this->prophet->getProphecies() as $objectProphecy) {
             foreach ($objectProphecy->getMethodProphecies() as $methodProphecies) {
                 foreach ($methodProphecies as $methodProphecy) {
                     if ($methodProphecy->getPrediction() !== null) {
                         $this->numAssertions++;
                     }
                 }
             }
         }
         $this->prophet->checkPredictions();
     }
 }