Last active
March 5, 2023 20:41
-
-
Save atishgoswami/d56f760647484451d075 to your computer and use it in GitHub Desktop.
Magento 2 Test App Page
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
<?php | |
use Magento\Framework\App\Bootstrap; | |
require __DIR__ . '../../../app/bootstrap.php'; | |
class TestApp extends \Magento\Framework\App\Http implements \Magento\Framework\AppInterface | |
{ | |
public function launch() | |
{ | |
/** | |
* @var $pluginInstance \Acme\Module\Plugin\Order\Model\TrackStatusPlugin | |
* @var $order \Magento\Sales\Api\OrderRepositoryInterface | |
*/ | |
$state = $this->_objectManager->get( | |
\Magento\Framework\App\State::class | |
); | |
$state->setAreaCode(\Magento\Framework\App\Area::AREA_FRONTEND); | |
$pluginInstance = $this->_objectManager->create( | |
\Acme\Module\Plugin\Order\Model\TrackStatusPlugin::class | |
); | |
$order = $this->_objectManager->create( | |
\Magento\Sales\Api\OrderRepositoryInterface::class | |
); | |
echo get_class($pluginInstance); | |
exit; | |
} | |
/** | |
* @inheritdoc | |
*/ | |
public function catchException(Bootstrap $bootstrap, \Exception $exception): bool | |
{ | |
return false; | |
} | |
} | |
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER); | |
$app = $bootstrap->createApplication('TestApp'); | |
$bootstrap->run($app); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment