Esempio n. 1
0
 public function setTest(test $test)
 {
     $asserter = null;
     $configuration = $test->getExtensionConfiguration($this);
     if ($configuration !== null) {
         $this->configuration = $configuration;
     }
     $test->getAssertionManager()->setHandler('blackfire', function (Client $client = null) use($test, &$asserter) {
         if ($asserter === null) {
             $asserter = new atoum\blackfire\asserters\blackfire($test->getAsserterGenerator());
         }
         if (null === $client) {
             $client = new Client($this->configuration->getClientConfiguration());
         }
         $asserter->setClient($client);
         $asserter->setWithTest($test);
         return $asserter;
     });
     return $this;
 }
Esempio n. 2
0
 public function testAssert()
 {
     $this->given($mockConfiguration = new \mock\Blackfire\Profile\Configuration())->and($testedClass = new testedClass())->and($testedClass->setConfiguration($mockConfiguration))->object($testedClass->assert("main.wall_time < 2s", 'assertname'))->isEqualto($testedClass)->mock($mockConfiguration)->call('assert')->once()->withArguments("main.wall_time < 2s", 'assertname');
     return;
 }