Skip to content

Commit

Permalink
Merge pull request #249 from kubawerlos/add_php_unit_fqcn_annotation
Browse files Browse the repository at this point in the history
PHPUnit annotations should be a FQCNs including a root namespace
  • Loading branch information
florianeckerstorfer authored Dec 2, 2019
2 parents 6c05172 + c271a18 commit dc19dbb
Show file tree
Hide file tree
Showing 15 changed files with 42 additions and 41 deletions.
1 change: 1 addition & 0 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'no_empty_phpdoc' => true,
'php_unit_fqcn_annotation' => true,
'php_unit_test_annotation' => true,
'phpdoc_trim' => true,
]);
4 changes: 2 additions & 2 deletions tests/Bridge/Laravel/SlugifyProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected function setUp()
}

/**
* @covers Cocur\Slugify\Bridge\Laravel\SlugifyServiceProvider::register()
* @covers \Cocur\Slugify\Bridge\Laravel\SlugifyServiceProvider::register()
*/
public function testRegisterRegistersTheServiceProvider()
{
Expand All @@ -56,7 +56,7 @@ public function testRegisterRegistersTheServiceProvider()
}

/**
* @covers Cocur\Slugify\Bridge\Laravel\SlugifyServiceProvider::provides()
* @covers \Cocur\Slugify\Bridge\Laravel\SlugifyServiceProvider::provides()
*/
public function testContainsReturnsTheNameOfThProvider()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Bridge/Latte/SlugifyHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protected function setUp()
}

/**
* @covers Cocur\Slugify\Bridge\Latte\SlugifyHelper::slugify()
* @covers \Cocur\Slugify\Bridge\Latte\SlugifyHelper::slugify()
*/
public function testSlugify()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Bridge/Nette/SlugifyExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protected function setUp()
}

/**
* @covers Cocur\Slugify\Bridge\Nette\SlugifyExtension::loadConfiguration()
* @covers \Cocur\Slugify\Bridge\Nette\SlugifyExtension::loadConfiguration()
*/
public function testLoadConfiguration()
{
Expand Down Expand Up @@ -75,7 +75,7 @@ public function testLoadConfiguration()
}

/**
* @covers Cocur\Slugify\Bridge\Nette\SlugifyExtension::beforeCompile()
* @covers \Cocur\Slugify\Bridge\Nette\SlugifyExtension::beforeCompile()
*/
public function testBeforeCompile()
{
Expand Down
8 changes: 4 additions & 4 deletions tests/Bridge/Plum/SlugifyConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
class SlugifyConverterTest extends MockeryTestCase
{
/**
* @covers Cocur\Slugify\Bridge\Plum\SlugifyConverter::__construct()
* @covers Cocur\Slugify\Bridge\Plum\SlugifyConverter::convert()
* @covers \Cocur\Slugify\Bridge\Plum\SlugifyConverter::__construct()
* @covers \Cocur\Slugify\Bridge\Plum\SlugifyConverter::convert()
*/
public function testConvertSlugifiesString()
{
Expand All @@ -39,8 +39,8 @@ public function testConvertSlugifiesString()
}

/**
* @covers Cocur\Slugify\Bridge\Plum\SlugifyConverter::__construct()
* @covers Cocur\Slugify\Bridge\Plum\SlugifyConverter::convert()
* @covers \Cocur\Slugify\Bridge\Plum\SlugifyConverter::__construct()
* @covers \Cocur\Slugify\Bridge\Plum\SlugifyConverter::convert()
*/
public function testConstructorCreatesSlugifyIfNoneIsProvided()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Bridge/Silex/SlugifySilexProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
class SlugifySilexProviderTest extends MockeryTestCase
{
/**
* @covers Cocur\Slugify\Bridge\Silex\SlugifyServiceProvider
* @covers \Cocur\Slugify\Bridge\Silex\SlugifyServiceProvider
*/
public function testRegister()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Bridge/Symfony/CocurSlugifyBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
class CocurSlugifyBundleTest extends MockeryTestCase
{
/**
* @covers Cocur\Slugify\Bridge\Symfony\CocurSlugifyBundle::getContainerExtension()
* @covers \Cocur\Slugify\Bridge\Symfony\CocurSlugifyBundle::getContainerExtension()
*/
public function testGetContainerExtension()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Bridge/Symfony/CocurSlugifyExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected function setUp()
}

/**
* @covers Cocur\Slugify\Bridge\Symfony\CocurSlugifyExtension::load()
* @covers \Cocur\Slugify\Bridge\Symfony\CocurSlugifyExtension::load()
*/
public function testLoad()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Bridge/Twig/SlugifyExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected function setUp()
}

/**
* @covers Cocur\Slugify\Bridge\Twig\SlugifyExtension::getFilters()
* @covers \Cocur\Slugify\Bridge\Twig\SlugifyExtension::getFilters()
*/
public function testGetFilters()
{
Expand All @@ -56,7 +56,7 @@ public function testGetFilters()
}

/**
* @covers Cocur\Slugify\Bridge\Twig\SlugifyExtension::slugifyFilter()
* @covers \Cocur\Slugify\Bridge\Twig\SlugifyExtension::slugifyFilter()
*/
public function testSlugifyFilter()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Bridge/ZF2/ModuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected function setUp()
}

/**
* @covers Cocur\Slugify\Bridge\ZF2\Module::getServiceConfig()
* @covers \Cocur\Slugify\Bridge\ZF2\Module::getServiceConfig()
*/
public function testGetServiceConfig()
{
Expand All @@ -36,7 +36,7 @@ public function testGetServiceConfig()
}

/**
* @covers Cocur\Slugify\Bridge\ZF2\Module::getViewHelperConfig()
* @covers \Cocur\Slugify\Bridge\ZF2\Module::getViewHelperConfig()
*/
public function testGetViewHelperConfig()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Bridge/ZF2/SlugifyServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protected function setUp()
}

/**
* @covers Cocur\Slugify\Bridge\ZF2\SlugifyService::__invoke()
* @covers \Cocur\Slugify\Bridge\ZF2\SlugifyService::__invoke()
*/
public function testInvokeWithoutCustomConfig()
{
Expand All @@ -40,7 +40,7 @@ public function testInvokeWithoutCustomConfig()
}

/**
* @covers Cocur\Slugify\Bridge\ZF2\SlugifyService::__invoke()
* @covers \Cocur\Slugify\Bridge\ZF2\SlugifyService::__invoke()
*/
public function testInvokeWithCustomConfig()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Bridge/ZF2/SlugifyViewHelperFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected function setUp()
}

/**
* @covers Cocur\Slugify\Bridge\ZF2\SlugifyViewHelperFactory::__invoke()
* @covers \Cocur\Slugify\Bridge\ZF2\SlugifyViewHelperFactory::__invoke()
*/
public function testCreateService()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Bridge/ZF2/SlugifyViewHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class SlugifyViewHelperTest extends MockeryTestCase
private $slugify;

/**
* @covers Cocur\Slugify\Bridge\ZF2\SlugifyViewHelper::__construct()
* @covers \Cocur\Slugify\Bridge\ZF2\SlugifyViewHelper::__construct()
*/
protected function setUp()
{
Expand All @@ -32,7 +32,7 @@ protected function setUp()
}

/**
* @covers Cocur\Slugify\Bridge\ZF2\SlugifyViewHelper::__invoke()
* @covers \Cocur\Slugify\Bridge\ZF2\SlugifyViewHelper::__invoke()
*/
public function testInvoke()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/RuleProvider/FileRuleProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
class FileRuleProviderTest extends MockeryTestCase
{
/**
* @covers Cocur\Slugify\RuleProvider\FileRuleProvider::__construct()
* @covers Cocur\Slugify\RuleProvider\FileRuleProvider::getRules()
* @covers \Cocur\Slugify\RuleProvider\FileRuleProvider::__construct()
* @covers \Cocur\Slugify\RuleProvider\FileRuleProvider::getRules()
*/
public function testGetRulesReturnsRulesReadFromJsonFile()
{
Expand Down
36 changes: 18 additions & 18 deletions tests/SlugifyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected function setUp()

/**
* @dataProvider defaultRuleProvider
* @covers Cocur\Slugify\Slugify::slugify()
* @covers \Cocur\Slugify\Slugify::slugify()
*/
public function testSlugifyReturnsSlugifiedStringUsingDefaultProvider($string, $result)
{
Expand All @@ -58,8 +58,8 @@ public function testSlugifyReturnsSlugifiedStringUsingDefaultProvider($string, $
}

/**
* @covers Cocur\Slugify\Slugify::addRule()
* @covers Cocur\Slugify\Slugify::slugify()
* @covers \Cocur\Slugify\Slugify::addRule()
* @covers \Cocur\Slugify\Slugify::slugify()
*/
public function testAddRuleAddsRule()
{
Expand All @@ -71,8 +71,8 @@ public function testAddRuleAddsRule()
}

/**
* @covers Cocur\Slugify\Slugify::addRules()
* @covers Cocur\Slugify\Slugify::slugify()
* @covers \Cocur\Slugify\Slugify::addRules()
* @covers \Cocur\Slugify\Slugify::slugify()
*/
public function testAddRulesAddsMultipleRules()
{
Expand All @@ -84,7 +84,7 @@ public function testAddRulesAddsMultipleRules()
}

/**
* @covers Cocur\Slugify\Slugify::activateRuleset()
* @covers \Cocur\Slugify\Slugify::activateRuleset()
*/
public function testActivateRulesetActivatesTheGivenRuleset()
{
Expand All @@ -101,15 +101,15 @@ public function testActivateRulesetActivatesTheGivenRuleset()
}

/**
* @covers Cocur\Slugify\Slugify::create()
* @covers \Cocur\Slugify\Slugify::create()
*/
public function testCreateReturnsAnInstance()
{
$this->assertInstanceOf('Cocur\\Slugify\\SlugifyInterface', Slugify::create());
}

/**
* @covers Cocur\Slugify\Slugify::__construct()
* @covers \Cocur\Slugify\Slugify::__construct()
*/
public function testConstructWithOtherRegexp()
{
Expand All @@ -119,8 +119,8 @@ public function testConstructWithOtherRegexp()
}

/**
* @covers Cocur\Slugify\Slugify::__construct()
* @covers Cocur\Slugify\Slugify::slugify()
* @covers \Cocur\Slugify\Slugify::__construct()
* @covers \Cocur\Slugify\Slugify::slugify()
*/
public function testDoNotConvertToLowercase()
{
Expand Down Expand Up @@ -162,8 +162,8 @@ public function customRulesProvider()
}

/**
* @covers Cocur\Slugify\Slugify::__construct()
* @covers Cocur\Slugify\Slugify::slugify()
* @covers \Cocur\Slugify\Slugify::__construct()
* @covers \Cocur\Slugify\Slugify::slugify()
*/
public function testSlugifyDefaultsToSeparatorOption()
{
Expand All @@ -175,8 +175,8 @@ public function testSlugifyDefaultsToSeparatorOption()
}

/**
* @covers Cocur\Slugify\Slugify::__construct()
* @covers Cocur\Slugify\Slugify::slugify()
* @covers \Cocur\Slugify\Slugify::__construct()
* @covers \Cocur\Slugify\Slugify::slugify()
*/
public function testSlugifyHonorsSeparatorArgument()
{
Expand All @@ -188,7 +188,7 @@ public function testSlugifyHonorsSeparatorArgument()
}

/**
* @covers Cocur\Slugify\Slugify::slugify()
* @covers \Cocur\Slugify\Slugify::slugify()
*/
public function testSlugifyOptionsArray()
{
Expand All @@ -210,7 +210,7 @@ public function testSlugifyOptionsArray()
}

/**
* @covers Cocur\Slugify\Slugify::slugify()
* @covers \Cocur\Slugify\Slugify::slugify()
*/
public function testSlugifyCustomRuleSet()
{
Expand Down Expand Up @@ -263,7 +263,7 @@ public function defaultRuleProvider()
}

/**
* @covers Cocur\Slugify\Slugify::slugify()
* @covers \Cocur\Slugify\Slugify::slugify()
*/
public function testSlugifyLowercaseNotAfterRegexp()
{
Expand All @@ -282,7 +282,7 @@ public function testSlugifyLowercaseNotAfterRegexp()
}

/**
* @covers Cocur\Slugify\Slugify::slugify()
* @covers \Cocur\Slugify\Slugify::slugify()
*/
public function testSlugifyLowercaseAfterRegexp()
{
Expand Down

0 comments on commit dc19dbb

Please sign in to comment.