Skip to content

Commit

Permalink
Merge pull request #580 from magento-firedrakes/bugs50
Browse files Browse the repository at this point in the history
[Firedrakes] Bugfixes
  • Loading branch information
sivaschenko committed Sep 9, 2015
2 parents 91eeac1 + 61c32a6 commit 73aa5bf
Show file tree
Hide file tree
Showing 29 changed files with 445 additions and 604 deletions.
36 changes: 16 additions & 20 deletions app/code/Magento/Cms/Setup/InstallSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
null,
['nullable' => false, 'default' => '1'],
'Is Block Active'
)->addIndex(
$setup->getIdxName(
$installer->getTable('cms_block'),
['title', 'identifier', 'content'],
AdapterInterface::INDEX_TYPE_FULLTEXT
),
['title', 'identifier', 'content'],
['type' => AdapterInterface::INDEX_TYPE_FULLTEXT]
)->setComment(
'CMS Block Table'
);
Expand Down Expand Up @@ -231,6 +239,14 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
)->addIndex(
$installer->getIdxName('cms_page', ['identifier']),
['identifier']
)->addIndex(
$setup->getIdxName(
$installer->getTable('cms_page'),
['title', 'meta_keywords', 'meta_description', 'identifier', 'content'],
AdapterInterface::INDEX_TYPE_FULLTEXT
),
['title', 'meta_keywords', 'meta_description', 'identifier', 'content'],
['type' => AdapterInterface::INDEX_TYPE_FULLTEXT]
)->setComment(
'CMS Page Table'
);
Expand Down Expand Up @@ -273,26 +289,6 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con
);
$installer->getConnection()->createTable($table);

$installer->getConnection()->addIndex(
$installer->getTable('cms_page'),
$setup->getIdxName(
$installer->getTable('cms_page'),
['title', 'meta_keywords', 'meta_description', 'identifier', 'content'],
AdapterInterface::INDEX_TYPE_FULLTEXT
),
['title', 'meta_keywords', 'meta_description', 'identifier', 'content'],
AdapterInterface::INDEX_TYPE_FULLTEXT
);
$installer->getConnection()->addIndex(
$installer->getTable('cms_block'),
$setup->getIdxName(
$installer->getTable('cms_block'),
['title', 'identifier', 'content'],
AdapterInterface::INDEX_TYPE_FULLTEXT
),
['title', 'identifier', 'content'],
AdapterInterface::INDEX_TYPE_FULLTEXT
);
$installer->endSetup();
}
}

This file was deleted.

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]
]
];
}
}

This file was deleted.

This file was deleted.

Loading

0 comments on commit 73aa5bf

Please sign in to comment.