You are here

public function DocParserTest::testSetValuesException in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Component/Annotation/Doctrine/DocParserTest.php \Drupal\Tests\Component\Annotation\Doctrine\DocParserTest::testSetValuesException()
  2. 10 core/tests/Drupal/Tests/Component/Annotation/Doctrine/DocParserTest.php \Drupal\Tests\Component\Annotation\Doctrine\DocParserTest::testSetValuesException()

File

core/tests/Drupal/Tests/Component/Annotation/Doctrine/DocParserTest.php, line 1219

Class

DocParserTest
@coversDefaultClass \Drupal\Component\Annotation\Doctrine\DocParser

Namespace

Drupal\Tests\Component\Annotation\Doctrine

Code

public function testSetValuesException() {
  $this
    ->expectException('\\Doctrine\\Common\\Annotations\\AnnotationException');
  $this
    ->expectExceptionMessage('[Creation Error] The annotation @SomeAnnotationClassNameWithoutConstructor declared on some class does not have a property named "invalidaProperty". Available properties: data, name');
  $docblock = <<<DOCBLOCK
/**
 * @SomeAnnotationClassNameWithoutConstructor(invalidaProperty = "Some val")
 */
DOCBLOCK;
  $this
    ->createTestParser()
    ->parse($docblock, 'some class');
}