Skip to content

Commit 0ae11d7

Browse files
author
Magento CICD
authored
merge magento/2.2-develop into magento-engcom/MAGETWO-71174
2 parents b152f68 + ef19ca6 commit 0ae11d7

File tree

5,139 files changed

+24858
-42460
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,139 files changed

+24858
-42460
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,6 @@ script:
5959
- test $TEST_SUITE = "functional" && TEST_FILTER='dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests.php' || true
6060

6161
# The scripts for grunt/phpunit type tests
62-
- if [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
62+
- if [ $TEST_SUITE == "functional" ]; then dev/tests/functional/vendor/phpunit/phpunit/phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
63+
- if [ $TEST_SUITE != "functional" ] && [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
6364
- if [ $TEST_SUITE == "js" ]; then grunt $GRUNT_COMMAND; fi

app/code/Magento/AdminNotification/Test/Unit/Block/ToolbarEntryTest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
namespace Magento\AdminNotification\Test\Unit\Block;
1111

12-
class ToolbarEntryTest extends \PHPUnit_Framework_TestCase
12+
class ToolbarEntryTest extends \PHPUnit\Framework\TestCase
1313
{
1414
/**
1515
* Retrieve toolbar entry block instance
@@ -21,12 +21,9 @@ protected function _getBlockInstance($unreadNotifications)
2121
{
2222
$objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
2323
// mock collection of unread notifications
24-
$notificationList = $this->getMock(
24+
$notificationList = $this->createPartialMock(
2525
\Magento\AdminNotification\Model\ResourceModel\Inbox\Collection\Unread::class,
26-
['getSize', 'setCurPage', 'setPageSize'],
27-
[],
28-
'',
29-
false
26+
['getSize', 'setCurPage', 'setPageSize']
3027
);
3128
$notificationList->expects($this->any())->method('getSize')->will($this->returnValue($unreadNotifications));
3229

app/code/Magento/AdminNotification/Test/Unit/Model/FeedTest.php

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
namespace Magento\AdminNotification\Test\Unit\Model;
88

9-
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
109
use Magento\Framework\Config\ConfigOptionsListConstants;
10+
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
1111

1212
/**
1313
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1414
*/
15-
class FeedTest extends \PHPUnit_Framework_TestCase
15+
class FeedTest extends \PHPUnit\Framework\TestCase
1616
{
1717
/** @var \Magento\AdminNotification\Model\Feed */
1818
protected $feed;
@@ -52,42 +52,27 @@ class FeedTest extends \PHPUnit_Framework_TestCase
5252

5353
protected function setUp()
5454
{
55-
$this->inboxFactory = $this->getMock(
55+
$this->inboxFactory = $this->createPartialMock(
5656
\Magento\AdminNotification\Model\InboxFactory::class,
57-
['create'],
58-
[],
59-
'',
60-
false
61-
);
62-
$this->curlFactory = $this->getMock(
63-
\Magento\Framework\HTTP\Adapter\CurlFactory::class,
64-
['create'],
65-
[],
66-
'',
67-
false
57+
['create']
6858
);
59+
$this->curlFactory = $this->createPartialMock(\Magento\Framework\HTTP\Adapter\CurlFactory::class, ['create']);
6960
$this->curl = $this->getMockBuilder(\Magento\Framework\HTTP\Adapter\Curl::class)
7061
->disableOriginalConstructor()->getMock();
71-
$this->appState = $this->getMock(\Magento\Framework\App\State::class, ['getInstallDate'], [], '', false);
72-
$this->inboxModel = $this->getMock(
73-
\Magento\AdminNotification\Model\Inbox::class,
74-
[
62+
$this->appState = $this->createPartialMock(\Magento\Framework\App\State::class, ['getInstallDate']);
63+
$this->inboxModel = $this->createPartialMock(\Magento\AdminNotification\Model\Inbox::class, [
7564
'__wakeup',
7665
'parse'
77-
],
78-
[],
79-
'',
80-
false
81-
);
82-
$this->backendConfig = $this->getMock(
66+
]);
67+
$this->backendConfig = $this->createPartialMock(
8368
\Magento\Backend\App\ConfigInterface::class,
8469
[
8570
'getValue',
8671
'setValue',
8772
'isSetFlag'
8873
]
8974
);
90-
$this->cacheManager = $this->getMock(
75+
$this->cacheManager = $this->createPartialMock(
9176
\Magento\Framework\App\CacheInterface::class,
9277
[
9378
'load',
@@ -106,7 +91,7 @@ protected function setUp()
10691
$this->productMetadata = $this->getMockBuilder(\Magento\Framework\App\ProductMetadata::class)
10792
->disableOriginalConstructor()->getMock();
10893

109-
$this->urlBuilder = $this->getMock(\Magento\Framework\UrlInterface::class);
94+
$this->urlBuilder = $this->createMock(\Magento\Framework\UrlInterface::class);
11095

11196
$this->feed = $this->objectManagerHelper->getObject(
11297
\Magento\AdminNotification\Model\Feed::class,

app/code/Magento/AdminNotification/Test/Unit/Model/NotificationServiceTest.php

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
namespace Magento\AdminNotification\Test\Unit\Model;
1111

12-
class NotificationServiceTest extends \PHPUnit_Framework_TestCase
12+
class NotificationServiceTest extends \PHPUnit\Framework\TestCase
1313
{
1414
/**
1515
* Retrieve instance of notification service model
@@ -23,19 +23,13 @@ protected function _getServiceInstanceForMarkAsReadTest($notificationId)
2323
* @var
2424
* $notificationFactory \PHPUnit_Framework_MockObject_MockObject|\Magento\AdminNotification\Model\InboxFactory
2525
*/
26-
$notificationFactory = $this->getMock(
26+
$notificationFactory = $this->createPartialMock(
2727
\Magento\AdminNotification\Model\InboxFactory::class,
28-
['create'],
29-
[],
30-
'',
31-
false
28+
['create']
3229
);
33-
$notification = $this->getMock(
30+
$notification = $this->createPartialMock(
3431
\Magento\AdminNotification\Model\Inbox::class,
35-
['load', 'getId', 'save', 'setIsRead', '__sleep', '__wakeup'],
36-
[],
37-
'',
38-
false
32+
['load', 'getId', 'save', 'setIsRead', '__sleep', '__wakeup']
3933
);
4034
$notification->expects($this->once())->method('load')->with($notificationId)->will($this->returnSelf());
4135
$notification->expects($this->once())->method('getId')->will($this->returnValue($notificationId));

app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/CacheOutdatedTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
namespace Magento\AdminNotification\Test\Unit\Model\System\Message;
77

8-
class CacheOutdatedTest extends \PHPUnit_Framework_TestCase
8+
class CacheOutdatedTest extends \PHPUnit\Framework\TestCase
99
{
1010
/**
1111
* @var \PHPUnit_Framework_MockObject_MockObject
@@ -29,9 +29,9 @@ class CacheOutdatedTest extends \PHPUnit_Framework_TestCase
2929

3030
protected function setUp()
3131
{
32-
$this->_authorizationMock = $this->getMock(\Magento\Framework\AuthorizationInterface::class);
33-
$this->_urlInterfaceMock = $this->getMock(\Magento\Framework\UrlInterface::class);
34-
$this->_cacheTypeListMock = $this->getMock(\Magento\Framework\App\Cache\TypeListInterface::class);
32+
$this->_authorizationMock = $this->createMock(\Magento\Framework\AuthorizationInterface::class);
33+
$this->_urlInterfaceMock = $this->createMock(\Magento\Framework\UrlInterface::class);
34+
$this->_cacheTypeListMock = $this->createMock(\Magento\Framework\App\Cache\TypeListInterface::class);
3535

3636
$objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
3737
$arguments = [
@@ -64,10 +64,10 @@ public function testGetIdentity($expectedSum, $cacheTypes)
6464

6565
public function getIdentityDataProvider()
6666
{
67-
$cacheTypeMock1 = $this->getMock(\stdClass::class, ['getCacheType']);
67+
$cacheTypeMock1 = $this->createPartialMock(\stdClass::class, ['getCacheType']);
6868
$cacheTypeMock1->expects($this->any())->method('getCacheType')->will($this->returnValue('Simple'));
6969

70-
$cacheTypeMock2 = $this->getMock(\stdClass::class, ['getCacheType']);
70+
$cacheTypeMock2 = $this->createPartialMock(\stdClass::class, ['getCacheType']);
7171
$cacheTypeMock2->expects($this->any())->method('getCacheType')->will($this->returnValue('Advanced'));
7272

7373
return [
@@ -97,7 +97,7 @@ public function testIsDisplayed($expected, $allowed, $cacheTypes)
9797

9898
public function isDisplayedDataProvider()
9999
{
100-
$cacheTypesMock = $this->getMock(\stdClass::class, ['getCacheType']);
100+
$cacheTypesMock = $this->createPartialMock(\stdClass::class, ['getCacheType']);
101101
$cacheTypesMock->expects($this->any())->method('getCacheType')->will($this->returnValue('someVal'));
102102
$cacheTypes = [$cacheTypesMock, $cacheTypesMock];
103103
return [

app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/Media/Synchronization/ErrorTest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
namespace Magento\AdminNotification\Test\Unit\Model\System\Message\Media\Synchronization;
77

8-
class ErrorTest extends \PHPUnit_Framework_TestCase
8+
class ErrorTest extends \PHPUnit\Framework\TestCase
99
{
1010
/**
1111
* @var \PHPUnit_Framework_MockObject_MockObject
@@ -24,9 +24,12 @@ class ErrorTest extends \PHPUnit_Framework_TestCase
2424

2525
protected function setUp()
2626
{
27-
$this->_syncFlagMock = $this->getMock(\Magento\MediaStorage\Model\File\Storage\Flag::class, [], [], '', false);
27+
$this->_syncFlagMock = $this->createPartialMock(
28+
\Magento\MediaStorage\Model\File\Storage\Flag::class,
29+
['setState', 'save', 'getFlagData']
30+
);
2831

29-
$this->_fileStorage = $this->getMock(\Magento\MediaStorage\Model\File\Storage\Flag::class, [], [], '', false);
32+
$this->_fileStorage = $this->createMock(\Magento\MediaStorage\Model\File\Storage\Flag::class);
3033
$this->_fileStorage->expects($this->any())->method('loadSelf')->will($this->returnValue($this->_syncFlagMock));
3134

3235
$objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);

app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/SecurityTest.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
namespace Magento\AdminNotification\Test\Unit\Model\System\Message;
77

8-
class SecurityTest extends \PHPUnit_Framework_TestCase
8+
class SecurityTest extends \PHPUnit\Framework\TestCase
99
{
1010
/**
1111
* @var \PHPUnit_Framework_MockObject_MockObject
@@ -35,14 +35,11 @@ class SecurityTest extends \PHPUnit_Framework_TestCase
3535
protected function setUp()
3636
{
3737
//Prepare objects for constructor
38-
$this->_cacheMock = $this->getMock(\Magento\Framework\App\CacheInterface::class);
39-
$this->_scopeConfigMock = $this->getMock(\Magento\Framework\App\Config\ScopeConfigInterface::class);
40-
$this->_curlFactoryMock = $this->getMock(
38+
$this->_cacheMock = $this->createMock(\Magento\Framework\App\CacheInterface::class);
39+
$this->_scopeConfigMock = $this->createMock(\Magento\Framework\App\Config\ScopeConfigInterface::class);
40+
$this->_curlFactoryMock = $this->createPartialMock(
4141
\Magento\Framework\HTTP\Adapter\CurlFactory::class,
42-
['create'],
43-
[],
44-
'',
45-
false
42+
['create']
4643
);
4744

4845
$objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
@@ -70,7 +67,7 @@ public function testIsDisplayed($expectedResult, $cached, $response)
7067
$this->_cacheMock->expects($this->any())->method('load')->will($this->returnValue($cached));
7168
$this->_cacheMock->expects($this->any())->method('save')->will($this->returnValue(null));
7269

73-
$httpAdapterMock = $this->getMock(\Magento\Framework\HTTP\Adapter\Curl::class, [], [], '', false);
70+
$httpAdapterMock = $this->createMock(\Magento\Framework\HTTP\Adapter\Curl::class);
7471
$httpAdapterMock->expects($this->any())->method('read')->will($this->returnValue($response));
7572
$this->_curlFactoryMock->expects($this->any())->method('create')->will($this->returnValue($httpAdapterMock));
7673

0 commit comments

Comments
 (0)