Skip to content

Instantly share code, notes, and snippets.

@wesolowski
Created August 17, 2017 05:44
Show Gist options
  • Save wesolowski/33762da397cd257b8b60071168a70cc9 to your computer and use it in GitHub Desktop.
Save wesolowski/33762da397cd257b8b60071168a70cc9 to your computer and use it in GitHub Desktop.
Shopware-Plugin test
<?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__);
}
}
<?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