Exemplo n.º 1
0
 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;
         }
     }
 }
Exemplo n.º 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;
         }
     }
 }
Exemplo n.º 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();
     }
 }