Example #1
0
 /**
  * Profiles the callback and test the result against the given configuration.
  */
 public function assertPhpUnit(\PHPUnit_Framework_TestCase $testCase, Profile\Configuration $config, $callback)
 {
     if (!$config->hasMetadata('skip_timeline')) {
         $config->setMetadata('skip_timeline', 'true');
     }
     try {
         $probe = $this->createProbe($config);
         $callback();
         $profile = $this->endProbe($probe);
         $testCase->assertThat($profile, new BlackfireConstraint());
     } catch (Exception\ExceptionInterface $e) {
         $testCase->markTestSkipped($e->getMessage());
     }
     return $profile;
 }