-
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 #580 from magento-firedrakes/bugs50
[Firedrakes] Bugfixes
- Loading branch information
Showing
29 changed files
with
445 additions
and
604 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
69 changes: 0 additions & 69 deletions
69
app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/OrderActionsTest.php
This file was deleted.
Oops, something went wrong.
98 changes: 98 additions & 0 deletions
98
app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/ViewActionTest.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,98 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\Sales\Test\Unit\Ui\Component\Listing\Column; | ||
|
||
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; | ||
use Magento\Framework\UrlInterface; | ||
use Magento\Sales\Ui\Component\Listing\Column\ViewAction; | ||
|
||
/** | ||
* Class ViewActionTest | ||
*/ | ||
class ViewActionTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @var ViewAction | ||
*/ | ||
protected $model; | ||
|
||
/** | ||
* @var UrlInterface|\PHPUnit_Framework_MockObject_MockObject | ||
*/ | ||
protected $urlBuilder; | ||
|
||
/** | ||
* @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager | ||
*/ | ||
protected $objectManager; | ||
|
||
public function setUp() | ||
{ | ||
$this->objectManager = new ObjectManager($this); | ||
$this->urlBuilder = $this->getMockForAbstractClass('Magento\Framework\UrlInterface'); | ||
} | ||
|
||
/** | ||
* @param array $data | ||
* @param array $dataSourceItems | ||
* @param array $expectedDataSourceItems | ||
* @param string $expectedUrlPath | ||
* @param array $expectedUrlParam | ||
* @dataProvider prepareDataSourceDataProvider | ||
*/ | ||
public function testPrepareDataSource( | ||
$data, | ||
$dataSourceItems, | ||
$expectedDataSourceItems, | ||
$expectedUrlPath, | ||
$expectedUrlParam | ||
) { | ||
$this->model = $this->objectManager->getObject( | ||
'Magento\Sales\Ui\Component\Listing\Column\ViewAction', | ||
[ | ||
'urlBuilder' => $this->urlBuilder, | ||
'data' => $data | ||
] | ||
); | ||
|
||
$this->urlBuilder->expects($this->once()) | ||
->method('getUrl') | ||
->with($expectedUrlPath, $expectedUrlParam) | ||
->willReturn('url'); | ||
|
||
$dataSource = [ | ||
'data' => [ | ||
'items' => $dataSourceItems | ||
] | ||
]; | ||
$this->model->prepareDataSource($dataSource); | ||
$this->assertEquals($expectedDataSourceItems, $dataSource['data']['items']); | ||
} | ||
|
||
/** | ||
* Data provider for testPrepareDataSource | ||
* @return array | ||
*/ | ||
public function prepareDataSourceDataProvider() | ||
{ | ||
return [ | ||
[ | ||
['name' => 'itemName', 'config' => []], | ||
[['itemName' => '', 'entity_id' => 1]], | ||
[['itemName' => ['view' => ['href' => 'url', 'label' => __('View')]], 'entity_id' => 1]], | ||
'#', | ||
['entity_id' => 1] | ||
], | ||
[ | ||
['name' => 'itemName', 'config' => ['viewUrlPath' => 'url_path', 'urlEntityParamName' => 'order_id']], | ||
[['itemName' => '', 'entity_id' => 2]], | ||
[['itemName' => ['view' => ['href' => 'url', 'label' => __('View')]], 'entity_id' => 2]], | ||
'url_path', | ||
['order_id' => 2] | ||
] | ||
]; | ||
} | ||
} |
74 changes: 0 additions & 74 deletions
74
app/code/Magento/Sales/Ui/Component/Listing/Column/OrderActions.php
This file was deleted.
Oops, something went wrong.
74 changes: 0 additions & 74 deletions
74
app/code/Magento/Sales/Ui/Component/Listing/Column/OrderCreditmemoActions.php
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.