This repository was archived by the owner on Jan 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 227
Added the support of the CacheBustingWorker #119
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,6 +151,28 @@ public function getUseControllerKeys() | |
); | ||
} | ||
|
||
/** | ||
* @dataProvider getCacheBustingWorkerKeys | ||
*/ | ||
public function testCacheBustingWorker($enabled) | ||
{ | ||
$extension = new AsseticExtension(); | ||
$extension->load(array(array('workers' => array('cache_busting' => array('enabled' => $enabled)))), $this->container); | ||
|
||
$def = $this->container->getDefinition('assetic.worker.cache_busting'); | ||
$this->assertSame($enabled, $def->hasTag('assetic.factory_worker')); | ||
|
||
$this->assertSaneContainer($this->getDumpedContainer()); | ||
} | ||
|
||
public function getCacheBustingWorkerKeys() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO thats worth two different tests
|
||
{ | ||
return array( | ||
array(true), | ||
array(false), | ||
); | ||
} | ||
|
||
/** | ||
* @dataProvider getClosureJarAndExpected | ||
*/ | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use strings rather than constants here and translate them downstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use strings. See the
->beforeNormalization()
on this node.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we change the value of the constants to be integers in the future,
config:dump-reference
would look very strange…There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well,
config:dump-reference
should probably be improved to be able take the normalization into account. But converting the string to the constant is exactly the job of the normalizationThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All I'm suggesting is that we change this line to…
…and the default value to
'content'
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and then, you are moving the configuration normalization work to the DI extension instead of the configuration tree where it belongs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, normalization is okay here.