-
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 #108 from magento-mpi/develop
[MPI] Sprint 58 contribution
- Loading branch information
Showing
60 changed files
with
1,939 additions
and
353 deletions.
There are no files selected for viewing
40 changes: 0 additions & 40 deletions
40
app/design/frontend/Magento/blank/Magento_RecurringPayment/web/css/source/_module.less
This file was deleted.
Oops, something went wrong.
77 changes: 0 additions & 77 deletions
77
app/design/frontend/Magento/luma/Magento_RecurringPayment/web/css/source/_module.less
This file was deleted.
Oops, something went wrong.
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
47 changes: 47 additions & 0 deletions
47
...ests/unit/testsuite/Magento/Framework/App/View/Asset/MaterializationStrategy/CopyTest.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,47 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Framework\App\View\Asset\MaterializationStrategy; | ||
|
||
class CopyTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @var Copy | ||
*/ | ||
private $copyPublisher; | ||
|
||
public function setUp() | ||
{ | ||
$this->copyPublisher = new Copy; | ||
} | ||
|
||
public function testPublishFile() | ||
{ | ||
$rootDir = $this->getMockBuilder('Magento\Framework\Filesystem\Directory\WriteInterface') | ||
->getMock(); | ||
$targetDir = $this->getMockBuilder('Magento\Framework\Filesystem\Directory\WriteInterface') | ||
->getMock(); | ||
$sourcePath = 'source/path/file'; | ||
$destinationPath = 'destination/path/file'; | ||
|
||
$rootDir->expects($this->once()) | ||
->method('copyFile') | ||
->with( | ||
$sourcePath, | ||
$destinationPath, | ||
$targetDir | ||
)->willReturn(true); | ||
|
||
$this->assertTrue($this->copyPublisher->publishFile($rootDir, $targetDir, $sourcePath, $destinationPath)); | ||
} | ||
|
||
public function testIsSupported() | ||
{ | ||
$asset = $this->getMockBuilder('Magento\Framework\View\Asset\LocalInterface') | ||
->getMock(); | ||
$this->assertTrue($this->copyPublisher->isSupported($asset)); | ||
} | ||
} |
101 changes: 101 additions & 0 deletions
101
...s/unit/testsuite/Magento/Framework/App/View/Asset/MaterializationStrategy/FactoryTest.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,101 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Framework\App\View\Asset\MaterializationStrategy; | ||
|
||
use Magento\Framework\ObjectManagerInterface; | ||
|
||
class FactoryTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @var ObjectManagerInterface | \PHPUnit_Framework_MockObject_MockObject | ||
*/ | ||
private $objectManager; | ||
|
||
public function setUp() | ||
{ | ||
$this->objectManager = $this->getMockBuilder('Magento\Framework\ObjectManagerInterface') | ||
->setMethods([]) | ||
->getMock(); | ||
} | ||
|
||
public function testCreateEmptyStrategies() | ||
{ | ||
$asset = $this->getAsset(); | ||
$copyStrategy = $this->getMockBuilder('Magento\Framework\App\View\Asset\MaterializationStrategy\Copy') | ||
->setMethods([]) | ||
->getMock(); | ||
$copyStrategy->expects($this->once()) | ||
->method('isSupported') | ||
->with($asset) | ||
->willReturn(true); | ||
|
||
$this->objectManager->expects($this->once()) | ||
->method('get') | ||
->with(Factory::DEFAULT_STRATEGY) | ||
->willReturn($copyStrategy); | ||
|
||
$factory = new Factory($this->objectManager, []); | ||
$this->assertSame($copyStrategy, $factory->create($asset)); | ||
} | ||
|
||
public function testCreateSupported() | ||
{ | ||
$asset = $this->getAsset(); | ||
$copyStrategy = $this->getMockBuilder('Magento\Framework\App\View\Asset\MaterializationStrategy\Copy') | ||
->setMethods([]) | ||
->getMock(); | ||
$copyStrategy->expects($this->once()) | ||
->method('isSupported') | ||
->with($asset) | ||
->willReturn(false); | ||
|
||
$supportedStrategy = $this->getMockBuilder( | ||
'Magento\Framework\App\View\Asset\MaterializationStrategy\StrategyInterface' | ||
) | ||
->setMethods([]) | ||
->getMock(); | ||
$supportedStrategy->expects($this->once()) | ||
->method('isSupported') | ||
->with($asset) | ||
->willReturn(true); | ||
|
||
$factory = new Factory($this->objectManager, [$copyStrategy, $supportedStrategy]); | ||
$this->assertSame($supportedStrategy, $factory->create($asset)); | ||
} | ||
|
||
public function testCreateException() | ||
{ | ||
$asset = $this->getAsset(); | ||
$copyStrategy = $this->getMockBuilder('Magento\Framework\App\View\Asset\MaterializationStrategy\Copy') | ||
->setMethods([]) | ||
->getMock(); | ||
$copyStrategy->expects($this->once()) | ||
->method('isSupported') | ||
->with($asset) | ||
->willReturn(false); | ||
|
||
$this->objectManager->expects($this->once()) | ||
->method('get') | ||
->with(Factory::DEFAULT_STRATEGY) | ||
->willReturn($copyStrategy); | ||
|
||
$factory = new Factory($this->objectManager, []); | ||
|
||
$this->setExpectedException('LogicException', 'No materialization strategy is supported'); | ||
$factory->create($asset); | ||
} | ||
|
||
/** | ||
* @return \Magento\Framework\View\Asset\LocalInterface | \PHPUnit_Framework_MockObject_MockObject | ||
*/ | ||
private function getAsset() | ||
{ | ||
return $this->getMockBuilder('Magento\Framework\View\Asset\LocalInterface') | ||
->setMethods([]) | ||
->getMock(); | ||
} | ||
} |
Oops, something went wrong.