Skip to content

Commit

Permalink
Merge pull request #107 from SenseException/coverage
Browse files Browse the repository at this point in the history
Add test for invalid service alias names
  • Loading branch information
shochdoerfer committed Sep 6, 2017
2 parents 027b5eb + d119c00 commit f0a8fd1
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/bitExpert/Disco/Annotations/AliasUnitTest.php
Expand Up @@ -61,4 +61,27 @@ public function aliasShouldBeNamedOrTypeAlias()
self::expectExceptionMessage('Alias should either be a named alias or a type alias!');
new Alias();
}

/**
* @test
* @dataProvider invalidNameProvider
*/
public function aliasNameCannotBeEmpty($name)
{
self::expectException(AnnotationException::class);
self::expectExceptionMessage('Alias should either be a named alias or a type alias!');
new Alias(['value' => ['name' => $name, 'type' => false]]);
}

public function invalidNameProvider()
{
return [
[''],
[0],
[0.0],
[false],
[null],
[[]],
];
}
}

0 comments on commit f0a8fd1

Please sign in to comment.