Skip to content

Commit 2774fbf

Browse files
committed
MC-40561: Stabilize unit tests
1 parent bedf99e commit 2774fbf

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

dev/tests/static/testsuite/Magento/Test/Legacy/LibraryLocationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static function setUpBeforeClass(): void
2626
public function testOldWebLibrariesLocation()
2727
{
2828
$oldLocation = self::$root . '/pub/lib';
29-
$this->assertFileNotExists($oldLocation, "The web libraries have been moved from 'pub/lib' to 'lib/web'");
29+
$this->assertFileDoesNotExist($oldLocation, "The web libraries have been moved from 'pub/lib' to 'lib/web'");
3030
}
3131

3232
public function testOldPhpLibrariesLocation()

dev/tests/static/testsuite/Magento/Test/Legacy/PhtmlTemplateTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function testBlockVariableInsteadOfThis()
2424
* @param string $file
2525
*/
2626
function ($file) {
27-
self::assertNotRegExp(
27+
self::assertDoesNotMatchRegularExpression(
2828
'/this->(?!helper)\S*/iS',
2929
file_get_contents($file),
3030
'Access to members and methods of Block class through $this is ' .
@@ -51,7 +51,7 @@ public function testObsoleteBlockMethods()
5151
* @param string $file
5252
*/
5353
function ($file) {
54-
self::assertNotRegexp(
54+
self::assertDoesNotMatchRegularExpression(
5555
'/block->_[^_]+\S*\(/iS',
5656
file_get_contents($file),
5757
'Access to protected and private members of Block class is ' .
@@ -73,7 +73,7 @@ public function testObsoleteJavascriptAttributeType()
7373
* @param string $file
7474
*/
7575
function ($file) {
76-
self::assertNotRegexp(
76+
self::assertDoesNotMatchRegularExpression(
7777
'/type="text\/javascript"/',
7878
file_get_contents($file),
7979
'Please do not use "text/javascript" type attribute.'
@@ -97,7 +97,7 @@ function ($file) {
9797
if (strpos($file, '/view/frontend/templates/') !== false
9898
|| strpos($file, '/view/base/templates/') !== false
9999
) {
100-
self::assertNotRegexp(
100+
self::assertDoesNotMatchRegularExpression(
101101
'/(["\'])jquery\/ui\1/',
102102
file_get_contents($file),
103103
'Please do not use "jquery/ui" library in templates. Use needed jquery ui widget instead.'
@@ -124,7 +124,7 @@ function ($file) {
124124
&& (strpos($file, '/view/frontend/templates/') !== false
125125
|| strpos($file, '/view/base/templates/') !== false)
126126
) {
127-
self::assertNotRegExp(
127+
self::assertDoesNotMatchRegularExpression(
128128
'/data-mage-init=(?:\'|")(?!\s*{\s*"[^"]+")/',
129129
file_get_contents($file),
130130
'Please do not initialize JS component in php. Do it in template.'
@@ -177,7 +177,7 @@ function ($file) {
177177
if (strpos($file, '/view/frontend/templates/') !== false
178178
|| strpos($file, '/view/base/templates/') !== false
179179
) {
180-
self::assertNotRegExp(
180+
self::assertDoesNotMatchRegularExpression(
181181
'@x-magento-init.>(?!\s*+{\s*"[^"]+"\s*:\s*{\s*"[\w/-]+")@i',
182182
file_get_contents($file),
183183
'Please do not initialize JS component in php. Do it in template.'

0 commit comments

Comments
 (0)