/** * @internal * * @param string $className * * @throws InvalidArgumentException */ function assertClassExists($className) { if (!class_exists($className)) { throw InvalidArgumentException::expectedValidClassName($className); } }
/** @test */ public function it_creates_an_exception_for_expected_string_but_got_an_object() { $exception = InvalidArgumentException::expectedString('param', new \stdClass()); $this->assertEquals('$param was expected to be a string; got instance of stdClass.', $exception->getMessage()); }