Created
August 17, 2017 05:44
-
-
Save wesolowski/33762da397cd257b8b60071168a70cc9 to your computer and use it in GitHub Desktop.
Shopware-Plugin test
This file contains hidden or 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
<?php | |
namespace FirstPlugin; | |
use Shopware\Components\Plugin; | |
/** | |
* Class FirstPlugin | |
* @package FirstPlugin | |
*/ | |
class FirstPlugin extends Plugin | |
{ | |
/** | |
* @return array | |
*/ | |
public static function getSubscribedEvents(): array | |
{ | |
return [ | |
'Enlight_Controller_Action_PreDispatch_Frontend_Detail' => 'dieInPreDispecth', | |
]; | |
} | |
/** | |
* @param \Enlight_Controller_ActionEventArgs $args | |
*/ | |
public function dieInPreDispecth(\Enlight_Controller_ActionEventArgs $args) | |
{ | |
die(__FILE__); | |
} | |
} |
This file contains hidden or 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
<?php | |
namespace FirstPlugin\Test\Functional; | |
class FirstPluginTest extends \Enlight_Components_Test_Controller_TestCase | |
{ | |
public function testDieInPreDispecth() | |
{ | |
$response = $this->dispatch('/detail/index/sArticle/8'); | |
dump($response); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment