private function createApp() { $app = new App(); $app->getKernel()->addProviders([ErrorHandlerProvider::class, BugsnagErrorHandlerProvider::class]); $config = new Config([BugsnagErrorHandlerConfig::CLIENT_ID => 'client_id', BugsnagErrorHandlerConfig::PROJECT_ROOT => __DIR__, BugsnagErrorHandlerConfig::HOSTNAME => 'hostname']); $app->getConfigLoader()->addConfig($config); $app->start(); return $app; }
private function createApp() { $app = new App(); $config = new Config(); $config->set(MonologConfig::DEFAULT_CHANNEL_NAME, 'error'); $config->set(MonologConfig::LOG_CHANNEL_FILE_PATH('error'), path(__DIR__, 'error.txt')); $config->set(MonologConfig::LOG_CHANNEL_LOG_LEVEL('error'), 'debug'); $config->set(MonologErrorHandlerConfig::ERROR_CHANNEL_NAME, 'error'); $app->getConfigLoader()->addConfig($config); return $app; }
/** * @param string $metadataFormat * @param bool $debug * * @return App */ public function createApp($metadataFormat = 'yaml', $debug = true) { $app = new App(); $config = new Config(); $config->set(DoctrineConfig::DEBUG, $debug); $config->set(DoctrineConfig::CONFIG, ['driver' => 'pdo_sqlite', 'memory' => true]); $config->set(DoctrineConfig::ENTITIES_MAPPINGS, []); $config->set(DoctrineConfig::ENTITIES_PATHS, []); $config->set(DoctrineConfig::METADATA_FORMAT, $metadataFormat); $config->set(DoctrineConfig::CACHE_PATH, '/tmp'); $config->set(DoctrineConfig::MIGRATIONS_PATH, '/tmp'); $config->set(DoctrineConfig::MIGRATIONS_NAMESPACE, 'migrations'); $config->set(DoctrineConfig::MIGRATIONS_TABLE, 'migrations'); $app->getConfigLoader()->addConfig($config); $app->getKernel()->addProvider(DoctrineProvider::class); return $app; }
public function test_it_adds_custom_environments() { $app = new App(); $this->assertNull($app->getConfigLoader()->getEnvironmentDetector()->detectEnvironment('foo_te')); $app->addEnvironment('test', ['te', 'st']); $this->assertEquals('test', $app->getConfigLoader()->getEnvironmentDetector()->detectEnvironment('foo_te')); }