Skip to content

Commit

Permalink
bugfix for incorrect tests introduced in liip#777
Browse files Browse the repository at this point in the history
  • Loading branch information
robfrawley committed Sep 15, 2016
1 parent 740c7e3 commit df8a8a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function create(ContainerBuilder $container, $resolverName, array $config
$resolverDefinition->replaceArgument(0, new Reference($config['filesystem_service']));
$resolverDefinition->replaceArgument(2, $config['root_url']);
$resolverDefinition->replaceArgument(3, $config['cache_prefix']);
$resolverDefinition->addArgument($config['visibility']);
$resolverDefinition->replaceArgument(4, $config['visibility']);
$resolverDefinition->addTag('liip_imagine.cache.resolver', array(
'resolver' => $resolverName,
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public function testCreateResolverDefinitionOnCreate()
'filesystem_service' => 'flyfilesystemservice',
'root_url' => 'http://images.example.com',
'cache_prefix' => 'theCachePrefix',
'visibility' => 'public',
));

$this->assertTrue($container->hasDefinition('liip_imagine.cache.resolver.theresolvername'));
Expand All @@ -62,13 +63,15 @@ public function testCreateResolverDefinitionOnCreate()

$this->assertEquals('http://images.example.com', $resolverDefinition->getArgument(2));
$this->assertEquals('theCachePrefix', $resolverDefinition->getArgument(3));
$this->assertEquals('public', $resolverDefinition->getArgument(4));
}

public function testProcessCorrectlyOptionsOnAddConfiguration()
{
$expectedRootUrl = 'http://images.example.com';
$expectedCachePrefix = 'theCachePrefix';
$expectedFlysystemService = 'flyfilesystemservice';
$expectedVisibility = 'public';

$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('flysystem', 'array');
Expand All @@ -81,6 +84,7 @@ public function testProcessCorrectlyOptionsOnAddConfiguration()
'root_url' => $expectedRootUrl,
'cache_prefix' => $expectedCachePrefix,
'filesystem_service' => $expectedFlysystemService,
'visibility' => 'public',
),
));

Expand All @@ -92,6 +96,9 @@ public function testProcessCorrectlyOptionsOnAddConfiguration()

$this->assertArrayHasKey('cache_prefix', $config);
$this->assertEquals($expectedCachePrefix, $config['cache_prefix']);

$this->assertArrayHasKey('visibility', $config);
$this->assertEquals($expectedVisibility, $config['visibility']);
}

/**
Expand Down

0 comments on commit df8a8a0

Please sign in to comment.