From d60539f0145ff35bf99a379d8f2957808fd07ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Thu, 1 Oct 2020 21:18:16 +0200 Subject: [PATCH 1/2] Simplify coverage annotations --- test/Compiler/DumpXmlContainerTest.php | 13 ++-- test/Compiler/ParameterBagTest.php | 13 ++-- test/CompilerTest.php | 55 ++++------------ test/Config/ContainerConfigurationTest.php | 73 +++++++++++----------- test/ContainerBuilderTest.php | 71 ++++++++------------- test/GeneratorTest.php | 27 ++++---- test/Testing/MakeServicesPublicTest.php | 13 +--- 7 files changed, 106 insertions(+), 159 deletions(-) diff --git a/test/Compiler/DumpXmlContainerTest.php b/test/Compiler/DumpXmlContainerTest.php index e22fd6c4..c81855ed 100644 --- a/test/Compiler/DumpXmlContainerTest.php +++ b/test/Compiler/DumpXmlContainerTest.php @@ -10,6 +10,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag as Parameters; +/** @coversDefaultClass \Lcobucci\DependencyInjection\Compiler\DumpXmlContainer */ final class DumpXmlContainerTest extends TestCase { /** @var ConfigCacheInterface&MockObject */ @@ -24,8 +25,8 @@ public function createConfig(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Compiler\DumpXmlContainer::__construct - * @covers \Lcobucci\DependencyInjection\Compiler\DumpXmlContainer::process + * @covers ::__construct + * @covers ::process */ public function processShouldBeSkippedWhenDevModeIsNotEnabled(): void { @@ -42,8 +43,8 @@ public function processShouldBeSkippedWhenDevModeIsNotEnabled(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Compiler\DumpXmlContainer::__construct - * @covers \Lcobucci\DependencyInjection\Compiler\DumpXmlContainer::process + * @covers ::__construct + * @covers ::process */ public function processShouldBeSkippedWhenCacheIsFresh(): void { @@ -60,8 +61,8 @@ public function processShouldBeSkippedWhenCacheIsFresh(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Compiler\DumpXmlContainer::__construct - * @covers \Lcobucci\DependencyInjection\Compiler\DumpXmlContainer::process + * @covers ::__construct + * @covers ::process */ public function processShouldDumpTheContainerUsingTheXmlDumper(): void { diff --git a/test/Compiler/ParameterBagTest.php b/test/Compiler/ParameterBagTest.php index 4856c5e5..ce8a14e9 100644 --- a/test/Compiler/ParameterBagTest.php +++ b/test/Compiler/ParameterBagTest.php @@ -6,13 +6,14 @@ use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ContainerBuilder; +/** @coversDefaultClass \Lcobucci\DependencyInjection\Compiler\ParameterBag */ final class ParameterBagTest extends TestCase { /** * @test * - * @covers \Lcobucci\DependencyInjection\Compiler\ParameterBag::__construct - * @covers \Lcobucci\DependencyInjection\Compiler\ParameterBag::set + * @covers ::__construct + * @covers ::set */ public function setShouldConfigureAParameter(): void { @@ -25,8 +26,8 @@ public function setShouldConfigureAParameter(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Compiler\ParameterBag::__construct - * @covers \Lcobucci\DependencyInjection\Compiler\ParameterBag::get + * @covers ::__construct + * @covers ::get */ public function getShouldReturnTheValueOfTheParameter(): void { @@ -38,7 +39,7 @@ public function getShouldReturnTheValueOfTheParameter(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Compiler\ParameterBag::get + * @covers ::get * * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag::__construct */ @@ -52,7 +53,7 @@ public function getShouldReturnTheDefaultValueWhenParameterDoesNotExist(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Compiler\ParameterBag::process + * @covers ::process * * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag::__construct */ diff --git a/test/CompilerTest.php b/test/CompilerTest.php index aea863d5..bfc33270 100644 --- a/test/CompilerTest.php +++ b/test/CompilerTest.php @@ -25,6 +25,15 @@ use function random_bytes; use function realpath; +/** + * @covers \Lcobucci\DependencyInjection\Compiler + * + * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag + * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration + * @uses \Lcobucci\DependencyInjection\Generator + * @uses \Lcobucci\DependencyInjection\Generators\Yaml + * @uses \Lcobucci\DependencyInjection\Testing\MakeServicesPublic + */ final class CompilerTest extends TestCase { private const EXPECTED_FILES = [ @@ -81,17 +90,7 @@ public function cleanUpDumpDirectory(): void exec('rm -rf ' . realpath($this->dumpDir . '/../../')); } - /** - * @test - * - * @covers \Lcobucci\DependencyInjection\Compiler - * - * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag - * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration - * @uses \Lcobucci\DependencyInjection\Generator - * @uses \Lcobucci\DependencyInjection\Generators\Yaml - * @uses \Lcobucci\DependencyInjection\Testing\MakeServicesPublic - */ + /** @test */ public function compileShouldCreateMultipleFiles(): void { $compiler = new Compiler(); @@ -107,17 +106,7 @@ public function compileShouldCreateMultipleFiles(): void } } - /** - * @test - * - * @covers \Lcobucci\DependencyInjection\Compiler - * - * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag - * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration - * @uses \Lcobucci\DependencyInjection\Generator - * @uses \Lcobucci\DependencyInjection\Generators\Yaml - * @uses \Lcobucci\DependencyInjection\Testing\MakeServicesPublic - */ + /** @test */ public function compileShouldTrackChangesOnTheConfigurationFile(): void { $compiler = new Compiler(); @@ -129,17 +118,7 @@ public function compileShouldTrackChangesOnTheConfigurationFile(): void ); } - /** - * @test - * - * @covers \Lcobucci\DependencyInjection\Compiler - * - * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag - * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration - * @uses \Lcobucci\DependencyInjection\Generator - * @uses \Lcobucci\DependencyInjection\Generators\Yaml - * @uses \Lcobucci\DependencyInjection\Testing\MakeServicesPublic - */ + /** @test */ public function compileShouldAllowForLazyServices(): void { file_put_contents( @@ -156,15 +135,7 @@ public function compileShouldAllowForLazyServices(): void self::assertCount(count($expectedFiles) + 1, $generatedFiles); } - /** - * @test - * - * @covers \Lcobucci\DependencyInjection\Compiler - * - * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag - * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration - * @uses \Lcobucci\DependencyInjection\Generator - */ + /** @test */ public function compilationShouldBeSkippedWhenFileAlreadyExists(): void { file_put_contents($this->dumpDir . '/AppContainer.php', 'testing'); diff --git a/test/Config/ContainerConfigurationTest.php b/test/Config/ContainerConfigurationTest.php index ac43f377..b5ab692c 100644 --- a/test/Config/ContainerConfigurationTest.php +++ b/test/Config/ContainerConfigurationTest.php @@ -19,6 +19,7 @@ use const DIRECTORY_SEPARATOR; +/** @coversDefaultClass \Lcobucci\DependencyInjection\Config\ContainerConfiguration */ final class ContainerConfigurationTest extends TestCase { /** @var CompilerPassInterface&MockObject */ @@ -33,9 +34,9 @@ public function configureDependencies(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::__construct - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::getFiles - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::filterPackages + * @covers ::__construct + * @covers ::getFiles + * @covers ::filterPackages * * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration::getPackages */ @@ -49,8 +50,8 @@ public function getFilesShouldReturnTheFileList(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::getFiles - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::filterPackages + * @covers ::getFiles + * @covers ::filterPackages * * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration::getPackages * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration::__construct @@ -87,8 +88,8 @@ public function getFiles(): Generator /** * @test * - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::__construct - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::addFile + * @covers ::__construct + * @covers ::addFile */ public function addFileShouldAppendANewFileToTheList(): void { @@ -101,8 +102,8 @@ public function addFileShouldAppendANewFileToTheList(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::getPassList - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::filterPackages + * @covers ::getPassList + * @covers ::filterPackages * * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration::getPackages * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration::__construct @@ -117,8 +118,8 @@ public function getPassListShouldReturnTheHandlersList(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::getPassList - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::filterPackages + * @covers ::getPassList + * @covers ::filterPackages * * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration::getPackages * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration::__construct @@ -161,8 +162,8 @@ public function getFiles(): Generator /** * @test * - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::__construct - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::addPass + * @covers ::__construct + * @covers ::addPass */ public function addPassShouldAppendANewHandlerToTheList(): void { @@ -181,8 +182,8 @@ public function addPassShouldAppendANewHandlerToTheList(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::__construct - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::addPass + * @covers ::__construct + * @covers ::addPass */ public function addPassCanReceiveTheTypeAndPriority(): void { @@ -201,8 +202,8 @@ public function addPassCanReceiveTheTypeAndPriority(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::__construct - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::addDelayedPass + * @covers ::__construct + * @covers ::addDelayedPass */ public function addDelayedPassShouldAppendANewCompilerPassToTheList(): void { @@ -221,8 +222,8 @@ public function addDelayedPassShouldAppendANewCompilerPassToTheList(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::__construct - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::addDelayedPass + * @covers ::__construct + * @covers ::addDelayedPass */ public function addDelayedPassCanReceiveTheTypeAndPriority(): void { @@ -241,8 +242,8 @@ public function addDelayedPassCanReceiveTheTypeAndPriority(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::__construct - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::addPackage + * @covers ::__construct + * @covers ::addPackage */ public function addPackageShouldAppendThePackageConfigurationToTheList(): void { @@ -264,7 +265,7 @@ public function addPackageShouldAppendThePackageConfigurationToTheList(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::getPackages + * @covers ::getPackages * * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration::__construct */ @@ -279,7 +280,7 @@ public function getPackagesShouldReturnAListOfInstantiatedPackages(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::getPackages + * @covers ::getPackages * * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration::__construct */ @@ -296,7 +297,7 @@ public function getPackagesShouldInstantiateThePackagesOnlyOnce(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::getPaths + * @covers ::getPaths * * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration::__construct */ @@ -310,8 +311,8 @@ public function getPathsShouldReturnThePathsList(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::__construct - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::addPath + * @covers ::__construct + * @covers ::addPath */ public function addPathShouldAppendANewPathToTheList(): void { @@ -331,8 +332,8 @@ public function addPathShouldAppendANewPathToTheList(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::setBaseClass - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::getBaseClass + * @covers ::setBaseClass + * @covers ::getBaseClass * * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration::__construct */ @@ -347,7 +348,7 @@ public function setBaseClassShouldChangeTheAttribute(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::getDumpDir + * @covers ::getDumpDir * * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration::__construct */ @@ -361,7 +362,7 @@ public function getDumpDirShouldReturnTheAttributeValue(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::setDumpDir + * @covers ::setDumpDir * * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration::__construct * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration::getDumpDir @@ -377,7 +378,7 @@ public function setDumpDirShouldChangeTheAttribute(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::getDumpFile + * @covers ::getDumpFile * * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration::__construct */ @@ -394,7 +395,7 @@ public function getDumpFileShouldReturnTheFullPathOfDumpFile(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::getDumpOptions + * @covers ::getDumpOptions * * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration::__construct */ @@ -413,8 +414,8 @@ public function getDumpOptionsShouldReturnTheDumpingInformation(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::setBaseClass - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::getDumpOptions + * @covers ::setBaseClass + * @covers ::getDumpOptions * * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration::__construct */ @@ -436,8 +437,8 @@ public function getDumpOptionsShouldIncludeBaseWhenWasConfigured(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::withSubNamespace - * @covers \Lcobucci\DependencyInjection\Config\ContainerConfiguration::getClassName + * @covers ::withSubNamespace + * @covers ::getClassName * * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration::__construct */ diff --git a/test/ContainerBuilderTest.php b/test/ContainerBuilderTest.php index 0ea2da7f..dcbcf5ca 100644 --- a/test/ContainerBuilderTest.php +++ b/test/ContainerBuilderTest.php @@ -18,6 +18,14 @@ use function get_class; use function iterator_to_array; +/** + * @coversDefaultClass \Lcobucci\DependencyInjection\ContainerBuilder + * + * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration + * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag + * @uses \Lcobucci\DependencyInjection\Generator + * @uses \Lcobucci\DependencyInjection\Generators\Xml + */ final class ContainerBuilderTest extends TestCase { /** @var Generator&MockObject */ @@ -36,14 +44,9 @@ public function configureDependencies(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\ContainerBuilder::default - * @covers \Lcobucci\DependencyInjection\ContainerBuilder::__construct - * @covers \Lcobucci\DependencyInjection\ContainerBuilder::setDefaultConfiguration - * - * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration - * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag - * @uses \Lcobucci\DependencyInjection\Generator - * @uses \Lcobucci\DependencyInjection\Generators\Xml + * @covers ::default + * @covers ::__construct + * @covers ::setDefaultConfiguration */ public function defaultShouldSimplifyTheObjectCreation(): void { @@ -59,8 +62,8 @@ public function defaultShouldSimplifyTheObjectCreation(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\ContainerBuilder::__construct - * @covers \Lcobucci\DependencyInjection\ContainerBuilder::setDefaultConfiguration + * @covers ::__construct + * @covers ::setDefaultConfiguration * * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag @@ -78,12 +81,10 @@ public function constructShouldReceiveTheDependenciesAsArguments(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\ContainerBuilder::setGenerator + * @covers ::setGenerator * * @uses \Lcobucci\DependencyInjection\ContainerBuilder::__construct * @uses \Lcobucci\DependencyInjection\ContainerBuilder::setDefaultConfiguration - * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration - * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag */ public function setGeneratorShouldChangeTheAttributeAndReturnSelf(): void { @@ -98,12 +99,10 @@ public function setGeneratorShouldChangeTheAttributeAndReturnSelf(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\ContainerBuilder::addFile + * @covers ::addFile * * @uses \Lcobucci\DependencyInjection\ContainerBuilder::__construct * @uses \Lcobucci\DependencyInjection\ContainerBuilder::setDefaultConfiguration - * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration - * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag */ public function addFileShouldAppendANewFileOnTheListAndReturnSelf(): void { @@ -116,12 +115,10 @@ public function addFileShouldAppendANewFileOnTheListAndReturnSelf(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\ContainerBuilder::addPass + * @covers ::addPass * * @uses \Lcobucci\DependencyInjection\ContainerBuilder::__construct * @uses \Lcobucci\DependencyInjection\ContainerBuilder::setDefaultConfiguration - * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration - * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag */ public function addPassShouldAppendANewHandlerOnTheListAndReturnSelf(): void { @@ -135,12 +132,10 @@ public function addPassShouldAppendANewHandlerOnTheListAndReturnSelf(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\ContainerBuilder::addDelayedPass + * @covers ::addDelayedPass * * @uses \Lcobucci\DependencyInjection\ContainerBuilder::__construct * @uses \Lcobucci\DependencyInjection\ContainerBuilder::setDefaultConfiguration - * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration - * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag */ public function addDelayedPassShouldAppendANewHandlerOnTheListAndReturnSelf(): void { @@ -154,12 +149,10 @@ public function addDelayedPassShouldAppendANewHandlerOnTheListAndReturnSelf(): v /** * @test * - * @covers \Lcobucci\DependencyInjection\ContainerBuilder::addPackage + * @covers ::addPackage * * @uses \Lcobucci\DependencyInjection\ContainerBuilder::__construct * @uses \Lcobucci\DependencyInjection\ContainerBuilder::setDefaultConfiguration - * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration - * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag */ public function addPackageShouldAppendANewHandlerOnTheListAndReturnSelf(): void { @@ -173,12 +166,10 @@ public function addPackageShouldAppendANewHandlerOnTheListAndReturnSelf(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\ContainerBuilder::setDumpDir + * @covers ::setDumpDir * * @uses \Lcobucci\DependencyInjection\ContainerBuilder::__construct * @uses \Lcobucci\DependencyInjection\ContainerBuilder::setDefaultConfiguration - * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration - * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag */ public function setDumpDirShouldChangeTheConfigureAndReturnSelf(): void { @@ -191,12 +182,10 @@ public function setDumpDirShouldChangeTheConfigureAndReturnSelf(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\ContainerBuilder::addPath + * @covers ::addPath * * @uses \Lcobucci\DependencyInjection\ContainerBuilder::__construct * @uses \Lcobucci\DependencyInjection\ContainerBuilder::setDefaultConfiguration - * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration - * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag */ public function addPathShouldAppendANewPathOnTheListAndReturnSelf(): void { @@ -209,12 +198,10 @@ public function addPathShouldAppendANewPathOnTheListAndReturnSelf(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\ContainerBuilder::setBaseClass + * @covers ::setBaseClass * * @uses \Lcobucci\DependencyInjection\ContainerBuilder::__construct * @uses \Lcobucci\DependencyInjection\ContainerBuilder::setDefaultConfiguration - * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration - * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag */ public function setBaseClassShouldConfigureTheBaseClassAndReturnSelf(): void { @@ -227,12 +214,10 @@ public function setBaseClassShouldConfigureTheBaseClassAndReturnSelf(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\ContainerBuilder::useDevelopmentMode + * @covers ::useDevelopmentMode * * @uses \Lcobucci\DependencyInjection\ContainerBuilder::__construct * @uses \Lcobucci\DependencyInjection\ContainerBuilder::setDefaultConfiguration - * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration - * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag */ public function useDevelopmentModeShouldChangeTheParameterAndReturnSelf(): void { @@ -247,12 +232,10 @@ public function useDevelopmentModeShouldChangeTheParameterAndReturnSelf(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\ContainerBuilder::setParameter + * @covers ::setParameter * * @uses \Lcobucci\DependencyInjection\ContainerBuilder::__construct * @uses \Lcobucci\DependencyInjection\ContainerBuilder::setDefaultConfiguration - * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration - * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag */ public function setParameterShouldConfigureTheParameterAndReturnSelf(): void { @@ -265,12 +248,10 @@ public function setParameterShouldConfigureTheParameterAndReturnSelf(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\ContainerBuilder::getContainer + * @covers ::getContainer * * @uses \Lcobucci\DependencyInjection\ContainerBuilder::__construct * @uses \Lcobucci\DependencyInjection\ContainerBuilder::setDefaultConfiguration - * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration - * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag */ public function getContainerShouldGenerateAndReturnTheContainer(): void { @@ -288,12 +269,10 @@ public function getContainerShouldGenerateAndReturnTheContainer(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\ContainerBuilder::getTestContainer + * @covers ::getTestContainer * * @uses \Lcobucci\DependencyInjection\ContainerBuilder::__construct * @uses \Lcobucci\DependencyInjection\ContainerBuilder::setDefaultConfiguration - * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration - * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag */ public function getTestContainerShouldGenerateAndReturnTheContainer(): void { diff --git a/test/GeneratorTest.php b/test/GeneratorTest.php index ab0d8868..be21ae9a 100644 --- a/test/GeneratorTest.php +++ b/test/GeneratorTest.php @@ -17,6 +17,14 @@ use Symfony\Component\DependencyInjection\ContainerBuilder as SymfonyBuilder; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; +/** + * @coversDefaultClass \Lcobucci\DependencyInjection\Generator + * + * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration + * @uses \Lcobucci\DependencyInjection\Compiler + * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag + * @uses \Lcobucci\DependencyInjection\Compiler\DumpXmlContainer + */ final class GeneratorTest extends TestCase { /** @var Generator&MockObject */ @@ -31,10 +39,8 @@ public function configureDependencies(): void /** * @test * - * @covers \Lcobucci\DependencyInjection\Generator::__construct - * @covers \Lcobucci\DependencyInjection\Generator::initializeContainer - * - * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration + * @covers ::__construct + * @covers ::initializeContainer */ public function initializeContainerShouldAddTheConfigurationFileAsAResource(): void { @@ -46,15 +52,10 @@ public function initializeContainerShouldAddTheConfigurationFileAsAResource(): v /** * @test * - * @covers \Lcobucci\DependencyInjection\Generator::__construct - * @covers \Lcobucci\DependencyInjection\Generator::generate - * @covers \Lcobucci\DependencyInjection\Generator::initializeContainer - * @covers \Lcobucci\DependencyInjection\Generator::loadContainer - * - * @uses \Lcobucci\DependencyInjection\Config\ContainerConfiguration - * @uses \Lcobucci\DependencyInjection\Compiler - * @uses \Lcobucci\DependencyInjection\Compiler\ParameterBag - * @uses \Lcobucci\DependencyInjection\Compiler\DumpXmlContainer + * @covers ::__construct + * @covers ::generate + * @covers ::initializeContainer + * @covers ::loadContainer */ public function generateShouldCompileAndLoadTheContainer(): void { diff --git a/test/Testing/MakeServicesPublicTest.php b/test/Testing/MakeServicesPublicTest.php index 227edaf1..453e804b 100644 --- a/test/Testing/MakeServicesPublicTest.php +++ b/test/Testing/MakeServicesPublicTest.php @@ -8,13 +8,10 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; +/** @covers \Lcobucci\DependencyInjection\Testing\MakeServicesPublic */ final class MakeServicesPublicTest extends TestCase { - /** - * @test - * - * @covers \Lcobucci\DependencyInjection\Testing\MakeServicesPublic - */ + /** @test */ public function processShouldMakeAllDefinedServicesPublic(): void { $service1 = new Definition('resource'); @@ -33,11 +30,7 @@ public function processShouldMakeAllDefinedServicesPublic(): void self::assertTrue($service2->isPublic()); } - /** - * @test - * - * @covers \Lcobucci\DependencyInjection\Testing\MakeServicesPublic - */ + /** @test */ public function processShouldMakeAllDefinedAliasesPublic(): void { $service = new Definition('resource'); From de4b20fb0578becc871ad7e856a67d860aa1f503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Thu, 1 Oct 2020 21:18:38 +0200 Subject: [PATCH 2/2] Use more appropriated assertions --- test/Compiler/ParameterBagTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/Compiler/ParameterBagTest.php b/test/Compiler/ParameterBagTest.php index ce8a14e9..85244f92 100644 --- a/test/Compiler/ParameterBagTest.php +++ b/test/Compiler/ParameterBagTest.php @@ -33,7 +33,7 @@ public function getShouldReturnTheValueOfTheParameter(): void { $pass = new ParameterBag(['test' => 1]); - self::assertEquals(1, $pass->get('test')); + self::assertSame(1, $pass->get('test')); } /** @@ -47,7 +47,7 @@ public function getShouldReturnTheDefaultValueWhenParameterDoesNotExist(): void { $pass = new ParameterBag(); - self::assertEquals(1, $pass->get('test', 1)); + self::assertSame(1, $pass->get('test', 1)); } /** @@ -63,6 +63,6 @@ public function invokeShouldAppendAllConfiguredParametersOnTheBuilder(): void $pass = new ParameterBag(['test' => 1]); $pass->process($builder); - self::assertEquals(1, $builder->getParameter('test')); + self::assertSame(1, $builder->getParameter('test')); } }