diff --git a/.gitignore b/.gitignore index ff72e2d..5e0f179 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /composer.lock /vendor +.phpunit.result.cache diff --git a/Tests/DependencyInjection/KPhoenRulerZExtensionTest.php b/Tests/DependencyInjection/KPhoenRulerZExtensionTest.php index 80fa669..4979c56 100644 --- a/Tests/DependencyInjection/KPhoenRulerZExtensionTest.php +++ b/Tests/DependencyInjection/KPhoenRulerZExtensionTest.php @@ -8,17 +8,15 @@ use org\bovigo\vfs\vfsStream; use KPhoen\RulerZBundle\DependencyInjection\KPhoenRulerZExtension; +use org\bovigo\vfs\vfsStreamDirectory; use Symfony\Bridge\RulerZ\Validator\Constraints\RuleValidator; use RulerZ\RulerZ; class KPhoenRulerZExtensionTest extends AbstractExtensionTestCase { - /** - * @var \org\bovigo\vfs\vfsStreamDirectory - */ - protected $root; + protected vfsStreamDirectory $root; - public function setUp() + public function setUp(): void { parent::setUp(); @@ -26,12 +24,12 @@ public function setUp() $this->setParameter('kernel.debug', true); } - protected function getContainerExtensions() + protected function getContainerExtensions(): array { return [new KPhoenRulerZExtension()]; } - protected function getMinimalConfiguration() + protected function getMinimalConfiguration(): array { return [ 'cache' => $this->root->url().'/cache', @@ -61,12 +59,10 @@ public function testItCreatesTheCacheDirectory() $this->assertTrue(is_dir($this->root->url().'/cache')); } - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Could not create cache directory - */ public function testItThrowsIfTheCacheDirectoryCanNotBeCreated() { + $this->expectException(\RuntimeException::class); + $this->expectExceptionMessage("Could not create cache directory"); $this->root = vfsStream::setup('rulerz_bundle', 0); $this->load(); @@ -86,11 +82,9 @@ public function testItLoadsTargetsDefinedInTheConfig() $this->assertContainerBuilderNotHasService('rulerz.target.elastica'); } - /** - * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException - */ public function testUnknownTargetsCantBeLoaded() { + $this->expectException(\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException::class); $this->load([ 'targets' => [ 'unknown' => null, diff --git a/composer.json b/composer.json index 09f12e4..4cd2ee8 100644 --- a/composer.json +++ b/composer.json @@ -14,14 +14,17 @@ "php": ">=7.1", "redeye/rulerz-bridge": "^3.0", "redeye/rulerz": "^2.0", - "symfony/config": "^4.4|^5.0", - "symfony/framework-bundle": "^4.4|^5.0" + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/framework-bundle": "^4.4|^5.0|^6.0" }, "require-dev": { "liip/rmt": "^1.2", "matthiasnoback/symfony-dependency-injection-test": "^4.1", "mikey179/vfsstream": "^1.6", - "phpunit/phpunit": "^7.1", - "symfony/phpunit-bridge": "^4.4|^5.0" - } + "phpunit/phpunit": "^7.1|^8.0", + "symfony/phpunit-bridge": "^4.4|^5.0|^6.0" + }, + "repositories": [ + { "type": "composer", "url": "https://repo.packagist.com/rdey/" } + ] }