Skip to content

Commit ae86946

Browse files
author
Cari Spruiell
committed
MAGETWO-38060: Fix test coverage builds
- fix creation of generated factory mocks
1 parent d66649b commit ae86946

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

app/code/Magento/Integration/Test/Unit/Helper/Oauth/ConsumerTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ class ConsumerTest extends \PHPUnit_Framework_TestCase
3939

4040
protected function setUp()
4141
{
42-
$this->_consumerFactory = $this->getMockBuilder(
43-
'Magento\Integration\Model\Oauth\ConsumerFactory'
44-
)->disableOriginalConstructor()->getMock();
42+
$this->_consumerFactory = $this->getMockBuilder('Magento\Integration\Model\Oauth\ConsumerFactory')
43+
->disableOriginalConstructor()
44+
->setMethods(['create'])
45+
->getMock();
4546
$this->_consumerMock = $this->getMockBuilder(
4647
'Magento\Integration\Model\Oauth\Consumer'
4748
)->disableOriginalConstructor()->getMock();

app/code/Magento/Integration/Test/Unit/Model/IntegrationServiceTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ class IntegrationServiceTest extends \PHPUnit_Framework_TestCase
4242

4343
protected function setUp()
4444
{
45-
$this->_integrationFactory = $this->getMockBuilder(
46-
'Magento\Integration\Model\IntegrationFactory'
47-
)->disableOriginalConstructor()->getMock();
45+
$this->_integrationFactory = $this->getMockBuilder('Magento\Integration\Model\IntegrationFactory')
46+
->disableOriginalConstructor()
47+
->setMethods(['create'])
48+
->getMock();
4849
$this->_integrationMock = $this->getMockBuilder(
4950
'Magento\Integration\Model\Integration'
5051
)->disableOriginalConstructor()->setMethods(

app/code/Magento/Integration/Test/Unit/Model/OauthServiceTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ class OauthServiceTest extends \PHPUnit_Framework_TestCase
5151
*/
5252
protected function setUp()
5353
{
54-
$this->_consumerFactory = $this->getMockBuilder(
55-
'Magento\Integration\Model\Oauth\ConsumerFactory'
56-
)->disableOriginalConstructor()->getMock();
54+
$this->_consumerFactory = $this->getMockBuilder('Magento\Integration\Model\Oauth\ConsumerFactory')
55+
->disableOriginalConstructor()
56+
->setMethods(['create'])
57+
->getMock();
5758
$this->_tokenProviderMock = $this->getMockBuilder(
5859
'Magento\Integration\Model\Oauth\Token\Provider'
5960
)->disableOriginalConstructor()->getMock();

app/code/Magento/Integration/Test/Unit/Oauth/OauthTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public function setUp()
5959
{
6060
$this->_consumerFactory = $this->getMockBuilder('Magento\Integration\Model\Oauth\ConsumerFactory')
6161
->disableOriginalConstructor()
62+
->setMethods(['create'])
6263
->getMock();
6364
$this->_consumerMock = $this->getMockBuilder('Magento\Integration\Model\Oauth\Consumer')
6465
->disableOriginalConstructor()->setMethods(
@@ -79,9 +80,10 @@ public function setUp()
7980
$this->_consumerFactory->expects($this->any())
8081
->method('create')
8182
->will($this->returnValue($this->_consumerMock));
82-
$this->_nonceFactory = $this->getMockBuilder(
83-
'Magento\Integration\Model\Oauth\NonceFactory'
84-
)->disableOriginalConstructor()->getMock();
83+
$this->_nonceFactory = $this->getMockBuilder('Magento\Integration\Model\Oauth\NonceFactory')
84+
->disableOriginalConstructor()
85+
->setMethods(['create'])
86+
->getMock();
8587
$this->_tokenFactory = $this->getMockBuilder(
8688
'Magento\Integration\Model\Oauth\TokenFactory'
8789
)->disableOriginalConstructor()->setMethods(['create'])->getMock();

0 commit comments

Comments
 (0)