8000 [property-info] Detect invalid tags and throw error accordingly by drupol · Pull Request #36850 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[property-info] Detect invalid tags and throw error accordingly #36850

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add new test.
  • Loading branch information
drupol committed May 18, 2020
commit 07cfd92be0f790751baeb1359d8983320d6cca5d
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function typesProvider()
['donotexist', null, null, null],
['staticGetter', null, null, null],
['staticSetter', null, null, null],
['emptyVar', null, null, null],
['emptyVar', null, 'This should not be removed.', null],
];
}

Expand Down Expand Up @@ -191,6 +191,14 @@ public function testReturnNullOnEmptyDocBlock()
$this->assertNull($this->extractor->getShortDescription(EmptyDocBlock::class, 'foo'));
}

public function testReturnNullOnIncompleteDocBlock()
{
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Failed to get the description of the @var tag "foo" for class "Symfony\Component\PropertyInfo\Tests\Extractor\IncompleteDocBlock". Please check that the @var tag is correctly defined.');

$this->extractor->getShortDescription(IncompleteDocBlock::class, 'foo');
}

public function dockBlockFallbackTypesProvider()
{
return [
Expand All @@ -215,6 +223,16 @@ public function testDocBlockFallback($property, $types)
}
}

class IncompleteDocBlock
{
/**
* @var
* @ORM\Id
* @ORM\Column(name="FOO", type="integer")
*/
public $foo;
}

class EmptyDocBlock
{
public $foo;
Expand Down
0