|
@@ 575-593 (lines=19) @@
|
| 572 |
|
$cacheManager->remove(null, array($expectedFilterOne, $expectedFilterTwo)); |
| 573 |
|
} |
| 574 |
|
|
| 575 |
|
public function testShouldDispatchCachePreResolveEvent() |
| 576 |
|
{ |
| 577 |
|
$dispatcher = $this->createEventDispatcherMock(); |
| 578 |
|
$dispatcher |
| 579 |
|
->expects($this->at(0)) |
| 580 |
|
->method('dispatch') |
| 581 |
|
->with(ImagineEvents::PRE_RESOLVE, new CacheResolveEvent('cats.jpg', 'thumbnail')) |
| 582 |
|
; |
| 583 |
|
|
| 584 |
|
$cacheManager = new CacheManager( |
| 585 |
|
$this->createFilterConfigurationMock(), |
| 586 |
|
$this->createRouterMock(), |
| 587 |
|
new Signer('secret'), |
| 588 |
|
$dispatcher |
| 589 |
|
); |
| 590 |
|
$cacheManager->addResolver('default', $this->createResolverMock()); |
| 591 |
|
|
| 592 |
|
$cacheManager->resolve('cats.jpg', 'thumbnail'); |
| 593 |
|
} |
| 594 |
|
|
| 595 |
|
public function testShouldDispatchCachePostResolveEvent() |
| 596 |
|
{ |
|
@@ 595-613 (lines=19) @@
|
| 592 |
|
$cacheManager->resolve('cats.jpg', 'thumbnail'); |
| 593 |
|
} |
| 594 |
|
|
| 595 |
|
public function testShouldDispatchCachePostResolveEvent() |
| 596 |
|
{ |
| 597 |
|
$dispatcher = $this->createEventDispatcherMock(); |
| 598 |
|
$dispatcher |
| 599 |
|
->expects($this->at(1)) |
| 600 |
|
->method('dispatch') |
| 601 |
|
->with(ImagineEvents::POST_RESOLVE, new CacheResolveEvent('cats.jpg', 'thumbnail')) |
| 602 |
|
; |
| 603 |
|
|
| 604 |
|
$cacheManager = new CacheManager( |
| 605 |
|
$this->createFilterConfigurationMock(), |
| 606 |
|
$this->createRouterMock(), |
| 607 |
|
new Signer('secret'), |
| 608 |
|
$dispatcher |
| 609 |
|
); |
| 610 |
|
$cacheManager->addResolver('default', $this->createResolverMock()); |
| 611 |
|
|
| 612 |
|
$cacheManager->resolve('cats.jpg', 'thumbnail'); |
| 613 |
|
} |
| 614 |
|
|
| 615 |
|
public function testShouldAllowToPassChangedDataFromPreResolveEventToResolver() |
| 616 |
|
{ |