-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #131 from magento-extensibility/MAGETWO-44798-disa…
…ble-varnish [Extensibility] Bugfix
- Loading branch information
Showing
6 changed files
with
80 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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 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 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
51 changes: 51 additions & 0 deletions
51
app/code/Magento/PageCache/Test/Unit/Model/Cache/TypeTest.php
This file contains 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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\PageCache\Test\Unit\Model\Cache; | ||
|
||
class TypeTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** @var \Magento\PageCache\Model\Cache\Type */ | ||
protected $model; | ||
|
||
/** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\Event\ManagerInterface */ | ||
protected $eventManagerMock; | ||
|
||
/** @var \PHPUnit_Framework_MockObject_MockObject | \Magento\Framework\App\Cache\Type\FrontendPool */ | ||
protected $cacheFrontendPoolMock; | ||
|
||
public function setUp() | ||
{ | ||
$this->eventManagerMock = $this->getMockBuilder('Magento\Framework\Event\ManagerInterface') | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
$this->cacheFrontendPoolMock = $this->getMockBuilder('Magento\Framework\App\Cache\Type\FrontendPool') | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
$cacheFrontend = $this->getMockBuilder('Magento\Framework\Cache\FrontendInterface') | ||
->disableOriginalConstructor() | ||
->getMock(); | ||
$this->cacheFrontendPoolMock->expects($this->once()) | ||
->method('get') | ||
->willReturn($cacheFrontend); | ||
$objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); | ||
$this->model = $objectManager->getObject( | ||
'Magento\PageCache\Model\Cache\Type', | ||
[ | ||
'eventManager' => $this->eventManagerMock, | ||
'cacheFrontendPool' => $this->cacheFrontendPoolMock, | ||
] | ||
); | ||
} | ||
|
||
public function testClean() | ||
{ | ||
$this->eventManagerMock->expects($this->once()) | ||
->method('dispatch') | ||
->with('adminhtml_cache_refresh_type'); | ||
|
||
$this->model->clean(); | ||
} | ||
} |
This file contains 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 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