public function setUp() { parent::setUp(); $this->app = new \Eccube\Application(array('env' => 'test')); $this->app->initialize(); $this->app->boot(); // CSRF tokenを無効にしてFormを作成 $this->form = $this->app['form.factory']->createBuilder('form', null, array('csrf_protection' => false))->add('tel', 'tel')->getForm(); }
/** * {@inheritdoc} */ public function createApplication() { $app = new Application(); $app->initialize(); $app['session.test'] = true; $app['exception_handler']->disable(); $app->boot(); return $app; }
public function __construct(\Eccube\Application $app, $name = null) { parent::__construct($name); $app['debug'] = true; $app->initialize(); // executeでdump($app)を使いたいので. $dumper = new \Sorien\Provider\PimpleDumpProvider(); $app->register($dumper, array('dumper' => $dumper)); $app->boot(); $this->app = $app; }
/** * {@inheritdoc} */ public function createApplication() { $app = new Application(); $app->initialize(); $app->initPluginEventDispatcher(); $app['session.test'] = true; $app['exception_handler']->disable(); $app['form.csrf_provider'] = $app->share(function () { return new CsrfTokenMock(); }); $app->boot(); return $app; }
public static function setUpBeforeClass() { // TODO Abstract にしたい. $app = new Application(); $app['debug'] = true; $app->initialize(); $app->initPluginEventDispatcher(); $app['session.test'] = true; $app['exception_handler']->disable(); $app->boot(); $softDeleteFilter = $app['orm.em']->getFilters()->getFilter('soft_delete'); $softDeleteFilter->setExcludes(array('Eccube\\Entity\\ProductClass')); // soft_delete filter を有効にする $config = $app['orm.em']->getConfiguration(); $config->addFilter("soft_delete", '\\Eccube\\Doctrine\\Filter\\SoftDeleteFilter'); $app['orm.em']->getFilters()->enable('soft_delete'); self::$app = $app; }
public function testInstallPluginWithConst() { #self::markTestSkipped(); // インストールするプラグインを作成する $tmpname = "dummy" . sha1(mt_rand()); $config = array(); $config['name'] = $tmpname . "_name"; $config['code'] = $tmpname; $config['version'] = $tmpname . "_version"; $config['const']['A'] = 'A'; $config['const']['C'] = 1; $tmpdir = $this->createTempDir(); $tmpfile = $tmpdir . '/plugin.tar'; $tar = new \PharData($tmpfile); $tar->addFromString('config.yml', Yaml::dump($config)); $service = $this->app['eccube.service.plugin']; // インストールできるか $this->assertTrue($service->install($tmpfile)); $this->assertTrue((bool) ($plugin = $this->app['eccube.repository.plugin']->findOneBy(array('code' => $tmpname)))); // インストール後disable状態でもconstがロードされているか $app = new Application(); $app->initialize(); $app->initializePlugin(); $app->boot(); $this->assertEquals('A', $app['config'][$tmpname]['const']['A']); $this->assertEquals('1', $app['config'][$tmpname]['const']['C']); // アンインストールできるか $this->assertTrue($service->uninstall($plugin)); }