8
8
9
9
use Magento \Catalog \Api \Data \ProductExtensionInterface ;
10
10
use Magento \Catalog \Model \Product ;
11
+ use Magento \Catalog \Model \Product \Attribute \Source \Status ;
11
12
use Magento \Framework \Api \Data \ImageContentInterface ;
12
13
use Magento \Framework \Api \ExtensibleDataInterface ;
13
14
use Magento \Framework \Api \ExtensionAttributesFactory ;
14
15
use Magento \Framework \TestFramework \Unit \Helper \ObjectManager as ObjectManagerHelper ;
15
- use Magento \Catalog \Model \Product \Attribute \Source \Status ;
16
16
17
17
/**
18
18
* Product Test
@@ -180,7 +180,7 @@ class ProductTest extends \PHPUnit\Framework\TestCase
180
180
/**
181
181
* @var \PHPUnit_Framework_MockObject_MockObject
182
182
*/
183
- private $ extensionAttrbutes ;
183
+ private $ extensionAttributes ;
184
184
185
185
/**
186
186
* @var \PHPUnit_Framework_MockObject_MockObject
@@ -200,7 +200,7 @@ class ProductTest extends \PHPUnit\Framework\TestCase
200
200
/**
201
201
* @var ProductExtensionInterface|\PHPUnit_Framework_MockObject_MockObject
202
202
*/
203
- private $ extensionAttributes ;
203
+ private $ productExtAttributes ;
204
204
205
205
/**
206
206
* @var \Magento\Eav\Model\Config|\PHPUnit_Framework_MockObject_MockObject
@@ -218,7 +218,7 @@ protected function setUp()
218
218
\Magento \Framework \Module \Manager::class,
219
219
['isEnabled ' ]
220
220
);
221
- $ this ->extensionAttrbutes = $ this ->getMockBuilder (\Magento \Framework \Api \ExtensionAttributesInterface::class)
221
+ $ this ->extensionAttributes = $ this ->getMockBuilder (\Magento \Framework \Api \ExtensionAttributesInterface::class)
222
222
->setMethods (['getWebsiteIds ' , 'setWebsiteIds ' ])
223
223
->disableOriginalConstructor ()
224
224
->getMock ();
@@ -372,13 +372,13 @@ protected function setUp()
372
372
$ this ->mediaConfig = $ this ->createMock (\Magento \Catalog \Model \Product \Media \Config::class);
373
373
$ this ->eavConfig = $ this ->createMock (\Magento \Eav \Model \Config::class);
374
374
375
- $ this ->extensionAttributes = $ this ->getMockBuilder (ProductExtensionInterface::class)
375
+ $ this ->productExtAttributes = $ this ->getMockBuilder (ProductExtensionInterface::class)
376
376
->setMethods (['getStockItem ' ])
377
377
->getMockForAbstractClass ();
378
378
$ this ->extensionAttributesFactory
379
379
->expects ($ this ->any ())
380
380
->method ('create ' )
381
- ->willReturn ($ this ->extensionAttributes );
381
+ ->willReturn ($ this ->productExtAttributes );
382
382
383
383
$ this ->filterCustomAttribute = $ this ->createTestProxy (
384
384
\Magento \Catalog \Model \FilterProductCustomAttribute::class
@@ -567,14 +567,6 @@ public function testGetCategoryId()
567
567
$ this ->assertEquals (10 , $ this ->model ->getCategoryId ());
568
568
}
569
569
570
- public function testGetCategoryIdWhenProductNotInCurrentCategory ()
571
- {
572
- $ this ->model ->setData ('category_ids ' , [12 ]);
573
- $ this ->category ->expects ($ this ->once ())->method ('getId ' )->will ($ this ->returnValue (10 ));
574
- $ this ->registry ->expects ($ this ->any ())->method ('registry ' )->will ($ this ->returnValue ($ this ->category ));
575
- $ this ->assertFalse ($ this ->model ->getCategoryId ());
576
- }
577
-
578
570
public function testGetIdBySku ()
579
571
{
580
572
$ this ->resource ->expects ($ this ->once ())->method ('getIdBySku ' )->will ($ this ->returnValue (5 ));
0 commit comments