public function testAppResolvesDatabaseService() { $path = realpath(__DIR__ . '/../../../'); $app = new Web($path); $_SERVER['REQUEST_URI'] = '/database'; $response = $app->boot(); unset($_SERVER['REQUEST_URI']); $this->assertInstanceOf('Fyuze\\Http\\Response', $response); //$this->assertEquals(200, $response->getStatusCode()); $this->assertEquals('{"name":"matthew"}', (string) $response->getBody()); }
public function testServiceRegistration() { $app = new Web(realpath(__DIR__ . '/../mocks')); $app->getContainer()->make('config')->set('app.error_handler.log_errors', false); $app->boot(); $container = $app->getContainer(); $this->assertInstanceOf('Fyuze\\Database\\Db', $container->make('db')); $this->assertInstanceOf('Fyuze\\Log\\Logger', $container->make('logger')); $this->assertInstanceOf('Fyuze\\Debug\\Toolbar', $container->make('toolbar')); $this->assertInstanceOf('Fyuze\\Event\\Emitter', $container->make('emitter')); }
<?php use Fyuze\Kernel\Application\Web; define('APP_START', microtime(true)); define('BASE_PATH', __DIR__ . '/../'); define('APP_PATH', BASE_PATH . '/app'); require BASE_PATH . '/vendor/autoload.php'; $app = new Web(BASE_PATH); $response = $app->boot(); include __DIR__ . '/../app/bootstrap.php'; $response->send();