eZ\Publish\Core\FieldType\Tests\FieldTypeTest::testAcceptValueFailsOnInvalidValues PHP Method

testAcceptValueFailsOnInvalidValues() public method

public testAcceptValueFailsOnInvalidValues ( mixed $inputValue, Exception $expectedException )
$inputValue mixed
$expectedException Exception
    public function testAcceptValueFailsOnInvalidValues($inputValue, $expectedException)
    {
        $fieldType = $this->getFieldTypeUnderTest();
        try {
            $fieldType->acceptValue($inputValue);
            $this->fail(sprintf('Expected exception of type "%s" not thrown on incorrect input to acceptValue().', $expectedException));
        } catch (Exception $e) {
            if ($e instanceof \PHPUnit_Framework_Exception || $e instanceof \PHPUnit_Framework_Error || $e instanceof \PHPUnit_Framework_AssertionFailedError) {
                throw $e;
            }
            $this->assertInstanceOf($expectedException, $e);
        }
    }