Skip to content

Commit 6b8f59c

Browse files
authored
Merge pull request #2811 from magento-borg/MC-2338
Fixed issues: - MC-2338 3rd party library/dependency upgrade for 2.3 pre Alpha
2 parents 113bf62 + 9bcb987 commit 6b8f59c

File tree

36 files changed

+820
-534
lines changed

36 files changed

+820
-534
lines changed

app/code/Magento/Analytics/Test/Unit/ReportXml/DB/ReportValidatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ protected function setUp()
7979
* @dataProvider errorDataProvider
8080
* @param string $reportName
8181
* @param array $result
82-
* @param \PHPUnit_Framework_MockObject_Stub $queryReturnStub
82+
* @param \PHPUnit\Framework\MockObject\Stub $queryReturnStub
8383
*/
84-
public function testValidate($reportName, $result, \PHPUnit_Framework_MockObject_Stub $queryReturnStub)
84+
public function testValidate($reportName, $result, \PHPUnit\Framework\MockObject\Stub $queryReturnStub)
8585
{
8686
$connectionName = 'testConnection';
8787
$this->queryFactoryMock->expects($this->once())

app/code/Magento/Checkout/Test/Unit/Controller/Index/IndexTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
use Magento\Customer\Model\Session;
1111
use Magento\Framework\App\Request\Http;
1212
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
13-
use PHPUnit_Framework_MockObject_Builder_InvocationMocker as InvocationMocker;
14-
use PHPUnit_Framework_MockObject_Matcher_InvokedCount as InvokedCount;
13+
use PHPUnit\Framework\MockObject\Builder\InvocationMocker as InvocationMocker;
14+
use PHPUnit\Framework\MockObject\Matcher\InvokedCount as InvokedCount;
1515
use PHPUnit_Framework_MockObject_MockObject as MockObject;
1616
use Magento\Checkout\Helper\Data;
1717
use Magento\Quote\Model\Quote;

app/code/Magento/Config/Test/Unit/Console/Command/ConfigShow/ValueProcessorTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ protected function setUp()
7373

7474
/**
7575
* @param bool $hasBackendModel
76-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsGetBackendModel
77-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsCreate
78-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsGetValue
79-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsSetPath
80-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsSetScope
81-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsSetScopeId
82-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsSetValue
83-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsAfterLoad
84-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectsSerialize
76+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsGetBackendModel
77+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsCreate
78+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsGetValue
79+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsSetPath
80+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsSetScope
81+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsSetScopeId
82+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsSetValue
83+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsAfterLoad
84+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectsSerialize
8585
* @param string $expectsValue
8686
* @param string $className
8787
* @param string $value

app/code/Magento/Config/Test/Unit/Model/Config/Structure/ElementVisibilityCompositeTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ public function testException()
5151
}
5252

5353
/**
54-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $firstExpects
54+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $firstExpects
5555
* @param bool $firstResult
56-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $secondExpects
56+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $secondExpects
5757
* @param bool $secondResult
5858
* @param bool $expectedResult
5959
* @dataProvider visibilityDataProvider
@@ -74,9 +74,9 @@ public function testDisabled($firstExpects, $firstResult, $secondExpects, $secon
7474
}
7575

7676
/**
77-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $firstExpects
77+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $firstExpects
7878
* @param bool $firstResult
79-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $secondExpects
79+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $secondExpects
8080
* @param bool $secondResult
8181
* @param bool $expectedResult
8282
* @dataProvider visibilityDataProvider

app/code/Magento/Developer/Test/Unit/Console/Command/DevTestsRunCommandTest.php

Lines changed: 86 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,101 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
namespace Magento\Developer\Test\Unit\Console\Command;
7+
// @codingStandardsIgnoreStart
88

9-
use Magento\Developer\Console\Command\DevTestsRunCommand;
10-
use Symfony\Component\Console\Tester\CommandTester;
9+
namespace Magento\Developer\Console\Command {
10+
use Symfony\Component\Console\Tester\CommandTester;
1111

12-
/**
13-
* Class DevTestsRunCommandTest
14-
*
15-
* Tests dev:tests:run command. Only tests error case because DevTestsRunCommand calls phpunit with
16-
* passthru, so there is no good way to mock out running the tests.
17-
*/
18-
class DevTestsRunCommandTest extends \PHPUnit\Framework\TestCase
19-
{
12+
$devTestsRunCommandTestPassthruReturnVar = null;
2013

2114
/**
22-
* @var DevTestsRunCommand
15+
* Mock for PHP builtin passthtru function
16+
*
17+
* @param string $command
18+
* @param int|null $return_var
19+
* @return void
20+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
2321
*/
24-
private $command;
25-
26-
protected function setUp()
22+
function passthru($command, &$return_var = null)
2723
{
28-
$this->command = new DevTestsRunCommand();
24+
global $devTestsRunCommandTestPassthruReturnVar;
25+
$return_var = $devTestsRunCommandTestPassthruReturnVar;
2926
}
3027

31-
public function testExecuteBadType()
28+
/**
29+
* Class DevTestsRunCommandTest
30+
*
31+
* Tests dev:tests:run command. Only tests error case because DevTestsRunCommand calls phpunit with
32+
* passthru, so there is no good way to mock out running the tests.
33+
*/
34+
class DevTestsRunCommandTest extends \PHPUnit\Framework\TestCase
3235
{
33-
$commandTester = new CommandTester($this->command);
34-
$commandTester->execute([DevTestsRunCommand::INPUT_ARG_TYPE => 'bad']);
35-
$this->assertContains('Invalid type: "bad"', $commandTester->getDisplay());
36-
}
3736

38-
public function testPassArgumentsToPHPUnit()
39-
{
40-
$commandTester = new CommandTester($this->command);
41-
$commandTester->execute(
42-
[
43-
DevTestsRunCommand::INPUT_ARG_TYPE => 'unit',
44-
'-' . DevTestsRunCommand::INPUT_OPT_COMMAND_ARGUMENTS_SHORT => '--list-suites',
45-
]
46-
);
47-
$this->assertContains(
48-
'phpunit --list-suites',
49-
$commandTester->getDisplay(),
50-
'Parameters should be passed to PHPUnit'
51-
);
37+
/**
38+
* @var DevTestsRunCommand
39+
*/
40+
private $command;
41+
42+
protected function setUp()
43+
{
44+
$this->command = new DevTestsRunCommand();
45+
}
46+
47+
public function testExecuteBadType()
48+
{
49+
$commandTester = new CommandTester($this->command);
50+
$commandTester->execute([DevTestsRunCommand::INPUT_ARG_TYPE => 'bad']);
51+
$this->assertContains('Invalid type: "bad"', $commandTester->getDisplay());
52+
}
53+
54+
public function testPassArgumentsToPHPUnit()
55+
{
56+
global $devTestsRunCommandTestPassthruReturnVar;
57+
58+
$devTestsRunCommandTestPassthruReturnVar = 0;
59+
60+
$commandTester = new CommandTester($this->command);
61+
$commandTester->execute(
62+
[
63+
DevTestsRunCommand::INPUT_ARG_TYPE => 'unit',
64+
'-' . DevTestsRunCommand::INPUT_OPT_COMMAND_ARGUMENTS_SHORT => '--list-suites',
65+
]
66+
);
67+
$this->assertContains(
68+
'phpunit --list-suites',
69+
$commandTester->getDisplay(),
70+
'Parameters should be passed to PHPUnit'
71+
);
72+
$this->assertContains(
73+
'PASSED (',
74+
$commandTester->getDisplay(),
75+
'PHPUnit runs should have passed'
76+
);
77+
}
78+
79+
public function testPassArgumentsToPHPUnitNegative()
80+
{
81+
global $devTestsRunCommandTestPassthruReturnVar;
82+
83+
$devTestsRunCommandTestPassthruReturnVar = 255;
84+
85+
$commandTester = new CommandTester($this->command);
86+
$commandTester->execute(
87+
[
88+
DevTestsRunCommand::INPUT_ARG_TYPE => 'unit',
89+
'-' . DevTestsRunCommand::INPUT_OPT_COMMAND_ARGUMENTS_SHORT => '--list-suites',
90+
]
91+
);
92+
$this->assertContains(
93+
'phpunit --list-suites',
94+
$commandTester->getDisplay(),
95+
'Parameters should be passed to PHPUnit'
96+
);
97+
$this->assertContains(
98+
'FAILED - ',
99+
$commandTester->getDisplay(),
100+
'PHPUnit runs should have passed'
101+
);
102+
}
52103
}
53104
}

app/code/Magento/Downloadable/Test/Unit/Ui/DataProvider/Product/Form/Modifier/Data/LinksTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ protected function setUp()
9898
/**
9999
* @param int|null $id
100100
* @param string $typeId
101-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectedGetTitle
102-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expectedGetValue
101+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectedGetTitle
102+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expectedGetValue
103103
* @return void
104104
* @dataProvider getLinksTitleDataProvider
105105
*/

app/code/Magento/Multishipping/view/frontend/templates/checkout/billing.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
if (isset($methodsForms[$code])) {
8080
$block->setMethodFormTemplate($code, $methodsForms[$code]);
8181
}
82-
?>
82+
?>
8383
<dt class="item-title">
8484
<?php if ($methodsCount > 1) : ?>
8585
<input type="radio"

app/code/Magento/Multishipping/view/frontend/templates/checkout/results.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ $orderIds = $block->getOrderIds();
1111
<div class="multicheckout results">
1212
<p class="block-content">
1313
<?php if (!empty($orderIds)) : ?>
14-
<?= $block->escapeHtml(__('Not all items were included.')); ?>
14+
<?= $block->escapeHtml(__('Not all items were included.')); ?>
1515
<?php endif; ?>
1616
<?= $block->escapeHtml(__('For details, see')); ?>
1717
<a href="#failed"><?= $block->escapeHtml(__('Failed to Order')); ?></a>

app/code/Magento/Multishipping/view/frontend/templates/checkout/success.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
<?php if ($shippingAddress) : ?>
2525
<span class="shipping-label"><?= $block->escapeHtml(__('Ship to:')); ?></span>
2626
<span class="shipping-address">
27-
<?= $block->escapeHtml(
28-
$block->getCheckoutData()->formatOrderShippingAddress($shippingAddress)
29-
); ?>
27+
<?= $block->escapeHtml(
28+
$block->getCheckoutData()->formatOrderShippingAddress($shippingAddress)
29+
); ?>
3030
</span>
3131
<?php else : ?>
3232
<span class="shipping-address">

app/code/Magento/Persistent/Test/Unit/Observer/CheckExpirePersistentQuoteObserverTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,18 @@ public function testExecuteWhenPersistentIsNotEnabled()
113113
*
114114
* @param string $refererUri
115115
* @param string $requestUri
116-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $expireCounter
117-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $dispatchCounter
118-
* @param \PHPUnit_Framework_MockObject_Matcher_InvokedCount $setCustomerIdCounter
116+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $expireCounter
117+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $dispatchCounter
118+
* @param \PHPUnit\Framework\MockObject\Matcher\InvokedCount $setCustomerIdCounter
119119
* @return void
120120
* @dataProvider requestDataProvider
121121
*/
122122
public function testExecuteWhenPersistentIsEnabled(
123123
string $refererUri,
124124
string $requestUri,
125-
\PHPUnit_Framework_MockObject_Matcher_InvokedCount $expireCounter,
126-
\PHPUnit_Framework_MockObject_Matcher_InvokedCount $dispatchCounter,
127-
\PHPUnit_Framework_MockObject_Matcher_InvokedCount $setCustomerIdCounter
125+
\PHPUnit\Framework\MockObject\Matcher\InvokedCount $expireCounter,
126+
\PHPUnit\Framework\MockObject\Matcher\InvokedCount $dispatchCounter,
127+
\PHPUnit\Framework\MockObject\Matcher\InvokedCount $setCustomerIdCounter
128128
): void {
129129
$this->persistentHelperMock
130130
->expects($this->once())

0 commit comments

Comments
 (0)