Skip to content

Commit

Permalink
Only return array
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-rose committed Sep 9, 2015
1 parent e2726b9 commit eebdcb7
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,6 @@ public function setup()
$this->component->setData('name', 'gender');
}

public function testPrepareDataSourceWithoutItems()
{
$dataSource = [
'data' => [

]
];
$this->attributeRepository->expects($this->never())
->method('getMetadataByCode');

$this->assertNull($this->component->prepareDataSource($dataSource));
}

public function testPrepareDataSource()
{
$genderOptionId = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ public function __construct(
*/
public function prepareDataSource(array $dataSource)
{
if (!isset($dataSource['data']['items'])) {
return null;
}

$metaData = $this->attributeRepository->getMetadataByCode($this->getName());
if ($metaData && count($metaData[AttributeMetadata::OPTIONS])) {
foreach ($dataSource['data']['items'] as &$item) {
Expand Down
1 change: 0 additions & 1 deletion app/code/Magento/Ui/Component/AbstractComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ public function getData($key = '', $index = null)
*
* @param array $dataSource
* @return array
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function prepareDataSource(array $dataSource)
{
Expand Down

0 comments on commit eebdcb7

Please sign in to comment.