/** * Test if the callback throws an exception * * @param callable $callback * @param string $expectedException * @param string $message */ function test_flight_throws(callable $callback, string $expectedException = '', string $message = '') { \Cundd\TestFlight\Assert::throws($callback, $expectedException, $message); }
/** * @test */ protected function getObjectSingletonTest() { test_flight_assert($this->get(__CLASS__) === $this); test_flight_assert($this->get(__CLASS__) === $this->get(__CLASS__)); test_flight_assert($this->get(__CLASS__) === $this->get(ObjectManager::class)); test_flight_assert($this->get(__CLASS__) === $this->get('Cundd\\TestFlight\\ObjectManager')); Assert::throws(function () { $this->get('Not_Existing_Class'); }, ClassDoesNotExistException::class); }