Skip to content

Commit

Permalink
🔃 [EngCom] Public Pull Requests - 2.3-develop
Browse files Browse the repository at this point in the history
Accepted Public Pull Requests:
 - magento#12977: Fixed Coding standards in TypeLocatorTest (by @dverkade)
  • Loading branch information
magento-team authored Jan 5, 2018
2 parents 62d6545 + 105a604 commit c10eacb
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions app/code/Magento/Eav/Test/Unit/Model/TypeLocatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
* See COPYING.txt for license details.
*/

// @codingStandardsIgnoreFile

namespace Magento\Eav\Test\Unit\Model;

use Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface;
use Magento\Eav\Model\TypeLocator;
use Magento\Eav\Model\TypeLocator\ComplexType as ComplexTypeLocator;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
Expand Down Expand Up @@ -66,7 +65,10 @@ public function testGetType(
$expected
) {
$this->complexType->expects($this->once())->method('getType')->willReturn($expected);
$type = $this->customAttributeTypeLocator->getType($attributeCode, $serviceEntityTypeMapData[$serviceClass]);
$type = $this->customAttributeTypeLocator->getType(
$attributeCode,
$serviceEntityTypeMapData[$serviceClass]
);

$this->assertEquals($expected, $type, 'Expected: ' . $expected . 'but got: ' . $type);
}
Expand All @@ -79,16 +81,22 @@ public function getTypeDataProvider()
{
$serviceInterface = \Magento\Catalog\Api\Data\ProductInterface::class;
$eavEntityType = 'catalog_product';
$mediaBackEndModelClass = \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface::class;
$mediaAttributeDataInterface = \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface::class;
$mediaBackEndModelClass = ProductAttributeMediaGalleryEntryInterface::class;
$mediaAttributeDataInterface = ProductAttributeMediaGalleryEntryInterface::class;

$attribute = $this->createPartialMock(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class, ['getBackendModel']);
$attribute = $this->createPartialMock(
\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class,
['getBackendModel']
);

$attribute->expects($this->any())
->method('getBackendModel')
->willReturn($mediaBackEndModelClass);

$attributeNoBackendModel = $this->createPartialMock(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class, ['getBackendModel', 'getFrontendInput']);
$attributeNoBackendModel = $this->createPartialMock(
\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class,
['getBackendModel', 'getFrontendInput']
);

$attributeNoBackendModel->expects($this->any())
->method('getBackendModel')
Expand Down

0 comments on commit c10eacb

Please sign in to comment.