-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply several code improvements and tests
- Loading branch information
Showing
11 changed files
with
80 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace Mbissonho\RememberAdminLastPage\Test\Integration; | ||
|
||
use Magento\TestFramework\TestCase\AbstractBackendController; | ||
|
||
/** | ||
* @magentoDbIsolation enabled | ||
*/ | ||
class RememberScriptAdminhtmlBlockTest extends AbstractBackendController | ||
{ | ||
const SCRIPT = "sessionStorage.setItem('mbissonho-last-admin-page-accessed', '{\"route_path\":\"customer\/index\/index\",\"edit_details\":{\"url_entity_param_name\":\"entity_id\",\"url_entity_param_value\":0}}')"; | ||
|
||
/** | ||
* @magentoConfigFixture admin/mbissonho_remember_admin_last_page/active 1 | ||
* @magentoAppIsolation enabled | ||
*/ | ||
public function testHtmlContainsRememberScriptOnceModuleIsEnabled() | ||
{ | ||
$this->dispatch('backend/customer/index/index/'); | ||
|
||
$body = $this->getResponse()->getBody(); | ||
$this->assertStringContainsString(self::SCRIPT, $body); | ||
} | ||
|
||
/** | ||
* @magentoConfigFixture admin/mbissonho_remember_admin_last_page/active 0 | ||
* @magentoAppIsolation enabled | ||
*/ | ||
public function testHtmlDoesNotContainsRememberScriptOnceModuleIsEnabled() | ||
{ | ||
$this->dispatch('backend/customer/index/index/'); | ||
|
||
$body = $this->getResponse()->getBody(); | ||
$this->assertStringNotContainsString(self::SCRIPT, $body); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters