public function testResetCount()
 {
     \Hamcrest\MatcherAssert::assertThat(true);
     self::assertEquals(1, \Hamcrest\MatcherAssert::getCount(), 'assertion count');
     \Hamcrest\MatcherAssert::resetCount();
     self::assertEquals(0, \Hamcrest\MatcherAssert::getCount(), 'assertion count');
 }
Esempio n. 2
0
 /**
  * Adds Hamcrest assertion counts to PHPUnit
  */
 public function runBare()
 {
     $e = null;
     ha::resetCount();
     try {
         parent::runBare();
     } catch (\Exception $e) {
     }
     $this->addToAssertionCount(ha::getCount());
     if ($e !== null) {
         throw $e;
     }
 }
 /**
  * Collects assertions performed by Hamcrest matchers during the test.
  *
  * @throws Exception
  */
 public function runBare()
 {
     MatcherAssert::resetCount();
     try {
         parent::runBare();
     } catch (\Exception $exception) {
         // rethrown below
     }
     $this->addToAssertionCount(MatcherAssert::getCount());
     if (isset($exception)) {
         throw $exception;
     }
 }
Esempio n. 4
0
 protected function setUp()
 {
     \Hamcrest\MatcherAssert::resetCount();
 }
 /**
  * @param PHPUnit_Framework_Test $test
  */
 public function startTest(\PHPUnit_Framework_Test $test)
 {
     MatcherAssert::resetCount();
 }