Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/composer.lock
/vendor
.phpunit.result.cache
22 changes: 8 additions & 14 deletions Tests/DependencyInjection/KPhoenRulerZExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,28 @@
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();

$this->root = vfsStream::setup('rulerz_bundle');
$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',
Expand Down Expand Up @@ -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();
Expand All @@ -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,
Expand Down
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/" }
]
}