Skip to content

Commit

Permalink
CS/PhpStan fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichel committed Sep 4, 2024
1 parent 75e548a commit ba8108a
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function testInitForm(): void
$mock->expects($this->any())
->method('getRegistryCurrentCustomer')
// phpcs:ignore Ecg.Classes.ObjectInstantiation.DirectInstantiation
->willReturn(new Mage_Customer_Model_Customer);
->willReturn(new Mage_Customer_Model_Customer());

$this->assertInstanceOf(Mage_Adminhtml_Block_Customer_Edit_Tab_Addresses::class, $mock->initForm());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function testInitForm(): void
$mock->expects($this->any())
->method('getRegistryCurrentCustomer')
// phpcs:ignore Ecg.Classes.ObjectInstantiation.DirectInstantiation
->willReturn(new Mage_Customer_Model_Customer);
->willReturn(new Mage_Customer_Model_Customer());

$this->assertInstanceOf(Mage_Adminhtml_Block_Customer_Edit_Tab_Newsletter::class, $mock->initForm());
}
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/Mage/Core/Helper/JsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public function testIncludeSkinScript(): void
*/
public function testGetDeleteConfirmJs(): void
{
$this->assertIsString($this->subject->getDeleteConfirmJs('foo'));
$this->assertIsString($this->subject->getDeleteConfirmJs('foo', 'bar'));
$this->assertStringStartsWith('deleteConfirm', $this->subject->getDeleteConfirmJs('foo'));
$this->assertStringStartsWith('deleteConfirm', $this->subject->getDeleteConfirmJs('foo', 'bar'));
}

/**
Expand All @@ -86,8 +86,8 @@ public function testGetDeleteConfirmJs(): void
*/
public function testGetConfirmSetLocationJs(): void
{
$this->assertIsString($this->subject->getConfirmSetLocationJs('foo'));
$this->assertIsString($this->subject->getConfirmSetLocationJs('foo', 'bar'));
$this->assertStringStartsWith('confirmSetLocation', $this->subject->getConfirmSetLocationJs('foo'));
$this->assertStringStartsWith('confirmSetLocation', $this->subject->getConfirmSetLocationJs('foo', 'bar'));
}

/**
Expand All @@ -96,7 +96,7 @@ public function testGetConfirmSetLocationJs(): void
*/
public function testGetSetLocationJs(): void
{
$this->assertIsString($this->subject->getSetLocationJs('foo'));
$this->assertStringStartsWith('setLocation', $this->subject->getSetLocationJs('foo'));
}

/**
Expand All @@ -105,6 +105,6 @@ public function testGetSetLocationJs(): void
*/
public function testGetSaveAndContinueEditJs(): void
{
$this->assertIsString($this->subject->getSaveAndContinueEditJs('foo'));
$this->assertStringStartsWith('saveAndContinueEdit', $this->subject->getSaveAndContinueEditJs('foo'));
}
}
2 changes: 1 addition & 1 deletion tests/unit/Mage/Core/Helper/StringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function testTruncate(): void
$this->assertSame('', $this->subject->truncate(null));
$this->assertSame('', $this->subject->truncate(self::TEST_STRING, 0));

$this->assertSame('', $this->subject->truncate(self::TEST_STRING, 3,));
$this->assertSame('', $this->subject->truncate(self::TEST_STRING, 3));

$remainder = '';
$this->assertSame('12...', $this->subject->truncate(self::TEST_STRING, 5, '...', $remainder, false));
Expand Down
1 change: 0 additions & 1 deletion tests/unit/Mage/Page/Block/Html/HeaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,5 @@ public function testGetLogoSrcSmall(): void
public function testGetLogoAlt(): void
{
$this->assertInstanceOf(Mage_Core_Model_Security_HtmlEscapedString::class, $this->subject->getLogoAlt());
$this->assertIsString((string)$this->subject->getLogoAlt());
}
}
2 changes: 1 addition & 1 deletion tests/unit/Mage/Page/Block/RedirectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function setUp(): void
*/
public function testGetTargetUrl(): void
{
$this->assertEquals('', $this->subject->getTargetUrl());
$this->assertEquals('', $this->subject->getTargetURL());
}

/**
Expand Down

0 comments on commit ba8108a

Please sign in to comment.