Skip to content

Commit 758fd26

Browse files
committed
MC-39900: Stabilize unit tests
- CS fixes
1 parent 8bc1248 commit 758fd26

File tree

9 files changed

+59
-32
lines changed

9 files changed

+59
-32
lines changed

app/code/Magento/Review/Test/Unit/Block/Adminhtml/RssTest.php

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,26 @@ public function testGetRssData()
123123
$this->assertEquals($rssData['charset'], $data['charset']);
124124
$this->assertEquals($rssData['entries']['title'], $data['entries'][0]['title']);
125125
$this->assertEquals($rssData['entries']['link'], $data['entries'][0]['link']);
126-
$this->assertStringContainsString($rssData['entries']['description']['rss_url'], $data['entries'][0]['description']);
127-
$this->assertStringContainsString($rssData['entries']['description']['name'], $data['entries'][0]['description']);
128-
$this->assertStringContainsString($rssData['entries']['description']['summary'], $data['entries'][0]['description']);
129-
$this->assertStringContainsString($rssData['entries']['description']['review'], $data['entries'][0]['description']);
130-
$this->assertStringContainsString($rssData['entries']['description']['store'], $data['entries'][0]['description']);
126+
$this->assertStringContainsString(
127+
$rssData['entries']['description']['rss_url'],
128+
$data['entries'][0]['description']
129+
);
130+
$this->assertStringContainsString(
131+
$rssData['entries']['description']['name'],
132+
$data['entries'][0]['description']
133+
);
134+
$this->assertStringContainsString(
135+
$rssData['entries']['description']['summary'],
136+
$data['entries'][0]['description']
137+
);
138+
$this->assertStringContainsString(
139+
$rssData['entries']['description']['review'],
140+
$data['entries'][0]['description']
141+
);
142+
$this->assertStringContainsString(
143+
$rssData['entries']['description']['store'],
144+
$data['entries'][0]['description']
145+
);
131146
}
132147

133148
/**

app/code/Magento/SalesRule/Test/Unit/Block/Rss/DiscountsTest.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,16 +175,20 @@ public function testGetRssData()
175175
$this->assertEquals($rssData['entries']['title'], $data['entries'][0]['title']);
176176
$this->assertEquals($rssData['entries']['link'], $data['entries'][0]['link']);
177177
$this->assertStringContainsString(
178-
$rssData['entries']['description']['description'], $data['entries'][0]['description']
178+
$rssData['entries']['description']['description'],
179+
$data['entries'][0]['description']
179180
);
180181
$this->assertStringContainsString(
181-
$rssData['entries']['description']['start_date'], $data['entries'][0]['description']
182+
$rssData['entries']['description']['start_date'],
183+
$data['entries'][0]['description']
182184
);
183185
$this->assertStringContainsString(
184-
$rssData['entries']['description']['end_date'], $data['entries'][0]['description']
186+
$rssData['entries']['description']['end_date'],
187+
$data['entries'][0]['description']
185188
);
186189
$this->assertStringContainsString(
187-
$rssData['entries']['description']['coupon_code'], $data['entries'][0]['description']
190+
$rssData['entries']['description']['coupon_code'],
191+
$data['entries'][0]['description']
188192
);
189193
}
190194

app/code/Magento/Theme/Test/Unit/Console/Command/ThemeUninstallCommandTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,15 +282,13 @@ public function setUpExecute()
282282
$this->themeUninstaller->expects($this->once())
283283
->method('uninstallRegistry')
284284
->with(
285-
$this->isInstanceOf(
286-
\Symfony\Component\Console\Output\OutputInterface::class),
285+
$this->isInstanceOf(\Symfony\Component\Console\Output\OutputInterface::class),
287286
$this->anything()
288287
);
289288
$this->themeUninstaller->expects($this->once())
290289
->method('uninstallCode')
291290
->with(
292-
$this->isInstanceOf(
293-
\Symfony\Component\Console\Output\OutputInterface::class),
291+
$this->isInstanceOf(\Symfony\Component\Console\Output\OutputInterface::class),
294292
$this->anything()
295293
);
296294
}

app/code/Magento/Vault/Test/Unit/Model/PaymentTokenManagementTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
/**
2525
* Class PaymentTokenManagementTest
2626
* Test for PaymentTokenManagement
27-
*
2827
* @see \Magento\Vault\Model\PaymentTokenManagement
2928
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
3029
*/

composer.lock

Lines changed: 16 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/internal/Magento/Framework/Profiler/Test/Unit/Driver/FactoryTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ public function testCreateUndefinedClass()
102102
public function testCreateInvalidClass()
103103
{
104104
$this->expectException(\InvalidArgumentException::class);
105-
$this->expectExceptionMessage('Driver class "stdClass" must implement \\Magento\\Framework\\Profiler\\DriverInterface.');
105+
$this->expectExceptionMessage(
106+
'Driver class "stdClass" must implement \\Magento\\Framework\\Profiler\\DriverInterface.'
107+
);
106108

107109
$this->_factory->create(['type' => 'stdClass']);
108110
}

lib/internal/Magento/Framework/TestFramework/Unit/Helper/ProxyTesting.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313

1414
/**
1515
* Class ProxyTesting
16+
*
1617
* Test for Proxy
1718
*/
1819
class ProxyTesting
1920
{
2021
/**
21-
* Invoke the proxy's method, imposing expectations on proxied object,
22-
* that it must be invoked as well with appropriate parameters.
22+
* Invoke the proxy's method, imposing expectations on proxied object, that it must be invoked as well.
2323
*
2424
* @param mixed $object Proxy
2525
* @param \PHPUnit\Framework\MockObject\MockObject $proxiedObject

lib/internal/Magento/Framework/Validator/Test/Unit/BuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
/**
99
* Class BuilderTest
10-
*
10+
* Test for Builder
1111
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1212
*/
1313
class BuilderTest extends \PHPUnit\Framework\TestCase

lib/internal/Magento/Framework/Webapi/Test/Unit/ErrorProcessorTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ public function testRenderJson()
7979
)->method(
8080
'encode'
8181
)->willReturnCallback(
82-
[$this, 'callbackJsonEncode'], $this->returnArgument(0)
82+
[$this, 'callbackJsonEncode'],
83+
$this->returnArgument(0)
8384
);
8485
/** Init output buffering to catch output via echo function. */
8586
ob_start();
@@ -119,7 +120,8 @@ public function testRenderJsonInDeveloperMode()
119120
)->method(
120121
'encode'
121122
)->willReturnCallback(
122-
[$this, 'callbackJsonEncode'], $this->returnArgument(0)
123+
[$this, 'callbackJsonEncode'],
124+
$this->returnArgument(0)
123125
);
124126
ob_start();
125127
$this->_errorProcessor->renderErrorMessage('Message', 'Message trace.', 401);
@@ -235,11 +237,9 @@ public function testCriticalExceptionStackTrace()
235237
$this->_loggerMock->expects($this->once())
236238
->method('critical')
237239
->willReturnCallback(
238-
239-
function (\Exception $loggedException) use ($thrownException) {
240-
$this->assertSame($thrownException, $loggedException->getPrevious());
241-
}
242-
240+
function (\Exception $loggedException) use ($thrownException) {
241+
$this->assertSame($thrownException, $loggedException->getPrevious());
242+
}
243243
);
244244
$this->_errorProcessor->maskException($thrownException);
245245
}

0 commit comments

Comments
 (0)