Respect\Validation\Exceptions\CheckExceptionsTest::testRuleHasAnExceptionWhichHasValidApi PHP Method

testRuleHasAnExceptionWhichHasValidApi() public method

    public function testRuleHasAnExceptionWhichHasValidApi($ruleName)
    {
        $exceptionClass = 'Respect\\Validation\\Exceptions\\' . $ruleName . 'Exception';
        $this->assertTrue(class_exists($exceptionClass), sprintf('Expected exception class to exist: %s.', $ruleName));
        $expectedMessage = 'Test exception message.';
        $exceptionObject = new $exceptionClass($expectedMessage);
        $this->assertInstanceOf('Exception', $exceptionObject, 'Every exception should extend an Exception class.');
        $this->assertInstanceOf(ValidationException::class, $exceptionObject, 'Every Respect/Validation exception must extend ValidationException.');
    }