/** * @param $test * @param \PhpSpock\PhpSpock $phpSpock * @return mixed | null */ public function run($test, \PhpSpock\PhpSpock $phpSpock) { try { return $phpSpock->run($test); } catch (AssertionException $e) { throw new \PHPUnit_Framework_ExpectationFailedException($e->getMessage()); } }
/** * @test * @expectedException PhpSpock\Specification\AssertionException */ public function executeTestFromCallback() { $phpSpock = new PhpSpock(); $phpSpock->run(array($this, 'mySpec')); }