Skip to content

Commit f57388c

Browse files
author
Cari Spruiell
committed
MAGETWO-38823: Stabilize builds
- fix unit test failures
1 parent 339e10b commit f57388c

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

app/code/Magento/CheckoutAgreements/Test/Unit/Model/CheckoutAgreementsRepositoryTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,7 @@ public function testGetListReturnsTheListOfActiveCheckoutAgreements()
120120
{
121121
$this->extensionAttributesJoinProcessorMock->expects($this->once())
122122
->method('process')
123-
->with(
124-
$this->isInstanceOf('Magento\CheckoutAgreements\Model\Resource\Agreement\Collection'),
125-
'\Magento\CheckoutAgreements\Api\Data\AgreementInterface'
126-
);
123+
->with($this->isInstanceOf('Magento\CheckoutAgreements\Model\Resource\Agreement\Collection'));
127124

128125
$this->scopeConfigMock->expects($this->once())
129126
->method('isSetFlag')

app/code/Magento/Eav/Test/Unit/Model/AttributeSetRepositoryTest.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ class AttributeSetRepositoryTest extends \PHPUnit_Framework_TestCase
4242
*/
4343
private $resultFactoryMock;
4444

45+
/**
46+
* @var \PHPUnit_Framework_MockObject_MockObject
47+
*/
48+
private $extensionAttributesJoinProcessorMock;
49+
4550
/**
4651
* @return void
4752
*/
@@ -76,12 +81,20 @@ protected function setUp()
7681
'',
7782
false
7883
);
84+
$this->extensionAttributesJoinProcessorMock = $this->getMock(
85+
'\Magento\Framework\Api\ExtensionAttribute\JoinProcessor',
86+
['process'],
87+
[],
88+
'',
89+
false
90+
);
7991
$this->model = new \Magento\Eav\Model\AttributeSetRepository(
8092
$this->resourceMock,
8193
$this->setFactoryMock,
8294
$this->collectionFactoryMock,
8395
$this->eavConfigMock,
84-
$this->resultFactoryMock
96+
$this->resultFactoryMock,
97+
$this->extensionAttributesJoinProcessorMock
8598
);
8699
}
87100

lib/internal/Magento/Framework/Api/Test/Unit/DataObjectHelperTest.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ class DataObjectHelperTest extends \PHPUnit_Framework_TestCase
4444
protected $attributeValueFactoryMock;
4545

4646
/**
47-
* @var \Magento\Framework\Api\ExtensionAttributesFactory|\PHPUnit_Framework_MockObject_MockObject
47+
* @var \Magento\Framework\Reflection\MethodsMap|\PHPUnit_Framework_MockObject_MockObject
4848
*/
49-
protected $extensionFactoryMock;
49+
protected $methodsMapProcessor;
5050

5151
/**
52-
* @var \Magento\Framework\Reflection\MethodsMap|\PHPUnit_Framework_MockObject_MockObject
52+
* @var \Magento\Framework\Api\ExtensionAttribute\JoinProcessor|\PHPUnit_Framework_MockObject_MockObject
5353
*/
54-
protected $methodsMapProcessor;
54+
protected $joinProcessorMock;
5555

5656
public function setUp()
5757
{
@@ -69,22 +69,23 @@ public function setUp()
6969
$this->attributeValueFactoryMock = $this->getMockBuilder('Magento\Framework\Api\AttributeValueFactory')
7070
->disableOriginalConstructor()
7171
->getMock();
72-
$this->extensionFactoryMock = $this->getMockBuilder('Magento\Framework\Api\ExtensionAttributesFactory')
72+
$this->joinProcessorMock = $this->getMockBuilder('\Magento\Framework\Api\ExtensionAttribute\JoinProcessor')
7373
->setMethods(['extractExtensionAttributes'])
7474
->disableOriginalConstructor()
7575
->getMock();
76-
$this->extensionFactoryMock->expects($this->any())
76+
$this->joinProcessorMock->expects($this->any())
7777
->method('extractExtensionAttributes')
7878
->willReturnArgument(1);
7979
$this->typeProcessor = $this->objectManager->getObject('Magento\Framework\Reflection\TypeProcessor');
80+
8081
$this->dataObjectHelper = $this->objectManager->getObject(
8182
'Magento\Framework\Api\DataObjectHelper',
8283
[
8384
'objectFactory' => $this->objectFactoryMock,
8485
'typeProcessor' => $this->typeProcessor,
8586
'objectProcessor' => $this->objectProcessorMock,
86-
'extensionFactory' => $this->extensionFactoryMock,
8787
'methodsMapProcessor' => $this->methodsMapProcessor,
88+
'joinProcessor' => $this->joinProcessorMock
8889
]
8990
);
9091
}

0 commit comments

Comments
 (0)