Skip to content

Commit 8d9167d

Browse files
committed
MC-39900: Stabilize unit test
- CS fixes
1 parent 070f8eb commit 8d9167d

File tree

47 files changed

+282
-151
lines changed

Some content is hidden

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

47 files changed

+282
-151
lines changed

app/code/Magento/AsynchronousOperations/Test/Unit/Model/OperationManagementTest.php

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

88
/**
99
* Class OperationManagementTest
10+
* Test for OperationManagement
1011
*/
1112
class OperationManagementTest extends \PHPUnit\Framework\TestCase
1213
{

app/code/Magento/Authorizenet/Test/Unit/Controller/Adminhtml/Authorizenet/Directpost/Payment/RedirectTest.php

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

1111
/**
1212
* Class RedirectTest
13-
*
13+
* Test for Redirect
1414
* @SuppressWarnings(PHPMD.TooManyFields)
1515
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1616
*/

app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Filter/DateTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ public function testGetHtmlSuccessfulTimestamp()
113113
$this->model->setValue($value);
114114

115115
$output = $this->model->getHtml();
116-
$this->assertStringContainsString('id="' . $uniqueHash . '_from" value="' . $yesterday->getTimestamp(), $output);
116+
$this->assertStringContainsString(
117+
'id="' . $uniqueHash . '_from" value="' . $yesterday->getTimestamp(),
118+
$output
119+
);
117120
$this->assertStringContainsString('id="' . $uniqueHash . '_to" value="' . $tomorrow->getTimestamp(), $output);
118121
}
119122

app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Filter/DatetimeTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ public function testGetHtmlSuccessfulTimestamp()
113113
$this->model->setValue($value);
114114

115115
$output = $this->model->getHtml();
116-
$this->assertStringContainsString('id="' . $uniqueHash . '_from" value="' . $yesterday->getTimestamp(), $output);
116+
$this->assertStringContainsString(
117+
'id="' . $uniqueHash . '_from" value="' . $yesterday->getTimestamp(),
118+
$output
119+
);
117120
$this->assertStringContainsString('id="' . $uniqueHash . '_to" value="' . $tomorrow->getTimestamp(), $output);
118121
}
119122

app/code/Magento/Backend/Test/Unit/Model/Menu/Item/ValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function testValidateWithDuplicateIdsThrowsException($existedItems, $newI
142142
$this->expectException(\InvalidArgumentException::class);
143143

144144
foreach ($existedItems as $item) {
145-
$item = array_merge($item, $this->_params);
145+
$item = array_merge($item, $this->_params);//phpcs:ignore
146146
$this->_model->validate($item);
147147
}
148148

app/code/Magento/Braintree/Test/Unit/Controller/Payment/GetNonceTest.php

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

2222
/**
2323
* Class GetNonceTest
24-
*
24+
* Test for GetNonce
2525
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2626
*/
2727
class GetNonceTest extends \PHPUnit\Framework\TestCase

app/code/Magento/Catalog/Test/Unit/Block/Rss/CategoryTest.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
/**
1212
* Class CategoryTest
13+
* Test for Category
1314
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1415
*/
1516
class CategoryTest extends \PHPUnit\Framework\TestCase
@@ -201,10 +202,19 @@ public function testGetRssData()
201202
$this->assertEquals($this->rssFeed['description'], $data['description']);
202203
$this->assertEquals($this->rssFeed['entries'][0]['title'], $data['entries'][0]['title']);
203204
$this->assertEquals($this->rssFeed['entries'][0]['link'], $data['entries'][0]['link']);
204-
$this->assertStringContainsString('<a href="http://magento.com/product.html">', $data['entries'][0]['description']);
205-
$this->assertStringContainsString('<img src="image_link" border="0" align="left" height="75" width="75">', $data['entries'][0]['description']);
205+
$this->assertStringContainsString(
206+
'<a href="http://magento.com/product.html">',
207+
$data['entries'][0]['description']
208+
);
209+
$this->assertStringContainsString(
210+
'<img src="image_link" border="0" align="left" height="75" width="75">',
211+
$data['entries'][0]['description']
212+
);
206213

207-
$this->assertStringContainsString('<td style="text-decoration:none;">Product Description </td>', $data['entries'][0]['description']);
214+
$this->assertStringContainsString(
215+
'<td style="text-decoration:none;">Product Description </td>',
216+
$data['entries'][0]['description']
217+
);
208218
}
209219

210220
public function testGetCacheLifetime()

app/code/Magento/Catalog/Test/Unit/Block/Rss/Product/NewProductsTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
/**
1111
* Class NewProductsTest
12-
* @package Magento\Catalog\Block\Rss\Product
12+
* Test for NewProducts
1313
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1414
*/
1515
class NewProductsTest extends \PHPUnit\Framework\TestCase
@@ -169,7 +169,10 @@ public function testGetRssData()
169169
unset($rssData['entries'][0]['description']);
170170
$this->assertEquals($data, $rssData);
171171
$this->assertStringContainsString('<a href="http://magento.com/product-name.html">', $description);
172-
$this->assertStringContainsString('<img src="image_link" border="0" align="left" height="75" width="75">', $description);
172+
$this->assertStringContainsString(
173+
'<img src="image_link" border="0" align="left" height="75" width="75">',
174+
$description
175+
);
173176
$this->assertStringContainsString('<td style="text-decoration:none;">Product Description </td>', $description);
174177
}
175178

app/code/Magento/Catalog/Test/Unit/Block/Rss/Product/SpecialTest.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
/**
1111
* Class SpecialTest
12+
* Test for Special
1213
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1314
*/
1415
class SpecialTest extends \PHPUnit\Framework\TestCase
@@ -157,8 +158,14 @@ public function testGetRssData()
157158
unset($rssData['entries'][0]['description']);
158159
$this->assertEquals($data, $rssData);
159160
$this->assertStringContainsString('<a href="http://magento.com/product-name.html"><', $description);
160-
$this->assertStringContainsString(sprintf('<p>Price: Special Price: 10<br />Special Expires On: %s</p>', date('Y-m-d')), $description);
161-
$this->assertStringContainsString('<img src="image_link" alt="" border="0" align="left" height="75" width="75" />', $description);
161+
$this->assertStringContainsString(
162+
sprintf('<p>Price: Special Price: 10<br />Special Expires On: %s</p>', date('Y-m-d')),
163+
$description
164+
);
165+
$this->assertStringContainsString(
166+
'<img src="image_link" alt="" border="0" align="left" height="75" width="75" />',
167+
$description
168+
);
162169
}
163170

164171
/**

app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
use Magento\Store\Model\StoreManagerInterface;
1717

1818
/**
19-
* Product Test
20-
*
19+
* Class ProductTest
20+
* Test for Product
2121
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2222
* @SuppressWarnings(PHPMD.TooManyFields)
2323
* @SuppressWarnings(PHPMD.ExcessivePublicCount)

0 commit comments

Comments
 (0)