public function NotNullValidatorTest::testNullIsInvalid

File

drupal/core/vendor/symfony/validator/Symfony/Component/Validator/Tests/Constraints/NotNullValidatorTest.php, line 56

Class

NotNullValidatorTest

Namespace

Symfony\Component\Validator\Tests\Constraints

Code

public function testNullIsInvalid() {
  $constraint = new NotNull(array(
    'message' => 'myMessage',
  ));
  $this->context
    ->expects($this
    ->once())
    ->method('addViolation')
    ->with('myMessage', array());
  $this->validator
    ->validate(null, $constraint);
}