Skip to content

Instantly share code, notes, and snippets.

@0-Sony
Created November 2, 2020 15:26
Show Gist options
  • Save 0-Sony/79776d6c408d94a27984294838f6deca to your computer and use it in GitHub Desktop.
Save 0-Sony/79776d6c408d94a27984294838f6deca to your computer and use it in GitHub Desktop.
Magento 2 : Script for Quick Test purpose
<?php
require __DIR__ . '/app/bootstrap.php';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
/** @var \Magento\Framework\App\Http $app */
$app = $bootstrap->createApplication('TestApp');
$bootstrap->run($app);
<?php
use Magento\Framework\App\Bootstrap;
class TestApp extends \Magento\Framework\App\Http implements \Magento\Framework\AppInterface
{
public function launch()
{
echo 'test';
//the method must end with this line
return $this->_response;
}
/**
* @inheritdoc
*/
public function catchException(Bootstrap $bootstrap, \Exception $exception): bool
{
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment