You are here

public function DocParserTest::testSetValuesException in Drupal 9

Same name and namespace in other branches
  1. 8 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 1216

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');
}