[AsseticBundle] Update the cache warmer tests
This commit is contained in:
parent
1191e3aa66
commit
f7b1839296
@ -24,13 +24,28 @@ class AssetManagerCacheWarmerTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testWarmUp()
|
||||
{
|
||||
$am = $this->getMockBuilder('Assetic\\Factory\\LazyAssetManager')
|
||||
$am = $this
|
||||
->getMockBuilder('Assetic\\Factory\\LazyAssetManager')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
->getMock()
|
||||
;
|
||||
|
||||
$am->expects($this->once())->method('load');
|
||||
|
||||
$warmer = new AssetManagerCacheWarmer($am);
|
||||
$container = $this
|
||||
->getMockBuilder('Symfony\\Component\\DependencyInjection\\Container')
|
||||
->setConstructorArgs(array())
|
||||
->getMock()
|
||||
;
|
||||
|
||||
$container
|
||||
->expects($this->once())
|
||||
->method('get')
|
||||
->with('assetic.asset_manager')
|
||||
->will($this->returnValue($am))
|
||||
;
|
||||
|
||||
$warmer = new AssetManagerCacheWarmer($container);
|
||||
$warmer->warmUp('/path/to/cache');
|
||||
}
|
||||
}
|
||||
|
@ -25,15 +25,33 @@ class AssetWriterCacheWarmerTest extends \PHPUnit_Framework_TestCase
|
||||
public function testWarmUp()
|
||||
{
|
||||
$am = $this->getMock('Assetic\\AssetManager');
|
||||
$writer = $this->getMockBuilder('Assetic\\AssetWriter')
|
||||
|
||||
$writer = $this
|
||||
->getMockBuilder('Assetic\\AssetWriter')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
->getMock()
|
||||
;
|
||||
|
||||
$writer->expects($this->once())
|
||||
$writer
|
||||
->expects($this->once())
|
||||
->method('writeManagerAssets')
|
||||
->with($am);
|
||||
->with($am)
|
||||
;
|
||||
|
||||
$warmer = new AssetWriterCacheWarmer($am, $writer);
|
||||
$container = $this
|
||||
->getMockBuilder('Symfony\\Component\\DependencyInjection\\Container')
|
||||
->setConstructorArgs(array())
|
||||
->getMock()
|
||||
;
|
||||
|
||||
$container
|
||||
->expects($this->once())
|
||||
->method('get')
|
||||
->with('assetic.asset_manager')
|
||||
->will($this->returnValue($am))
|
||||
;
|
||||
|
||||
$warmer = new AssetWriterCacheWarmer($container, $writer);
|
||||
$warmer->warmUp('/path/to/cache');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user