public function __invoke() { $error = new \Error(); $ok = Result::failed($error); Assert::same($ok->isPassed(), false); Assert::same($ok->getError(), $error); }
public function __invoke() { $testRunner = new Runner(); $error = new \Exception(); $failingTest = function () use($error) { throw $error; }; $expected = Result::failed($error); Assert::like($testRunner($failingTest), $expected); }
public function __invoke() { $suite = new Suite(); $exception = new \Exception(); $suite->addTest(function () { }, 'passing test 1'); $suite->addTest(function () use($exception) { throw $exception; }, 'failing test'); $suite->addTest(function () { }, 'passing test 2'); $result = $suite(new Runner()); $expected = Result::failed($exception); Assert::like($result, $expected); }