Skip to content

[FrameworkBundle] fix assets and templating tests #17658

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 3, 2016
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -547,11 +547,7 @@ private function registerTemplatingConfiguration(array $config, $ide, ContainerB
'Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader\\FilesystemLoader',
));

if ($container->hasDefinition('assets.packages')) {
$container->getDefinition('templating.helper.assets')->replaceArgument(0, new Reference('assets.packages'));
} else {
$container->removeDefinition('templating.helper.assets');
}
$container->getDefinition('templating.helper.assets')->replaceArgument(0, new Reference('assets.packages'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it still possible to disable the asset system if we don't need it ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would mean to revert #17506.

}
}

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,15 @@ public function testAssetHelperWhenAssetsAreEnabled()

public function testAssetHelperWhenTemplatesAreEnabledAndAssetsAreDisabled()
{
$container = $this->createContainerFromFile('assets_disabled');
$container = $this->createContainerFromFile('full');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't we remove also src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/assets_disabled.*?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good catch. Thanks!

$packages = $container->getDefinition('templating.helper.assets')->getArgument(0);

$this->assertSame('assets.packages', (string) $packages);
}

public function testAssetHelperWhenAssetsAndTemplatesAreDisabled()
{
$container = $this->createContainerFromFile('default_config');

$this->assertFalse($container->hasDefinition('templating.helper.assets'));
}
Expand Down