public function test_error_reporting__display() { $this->setExpectedException('PHPUnit_Framework_Error'); $app = \Staq\App::create()->setPlatform('local'); $this->assertEquals(1, ini_get('display_errors')); trigger_error('Test of warnings', E_USER_ERROR); }
public function test_route_function() { $this->getRequestUrl('http://localhost/coco'); $app = \Staq\App::create($this->projectNamespace)->setPlatform('local')->setBaseUri('/prefix/path/')->addController('/*', function () { return new \Stack\View\Extension\RouteFunction(); })->run(); $this->expectOutputString('/prefix/path/error/418'); }
protected function setUp() { $app = \Staq\App::create($this->projectNamespace)->setPlatform('local'); }
public function test_public_controller__match() { $this->getRequestUrl('http://localhost/static.txt'); \Staq\App::create($this->projectNamespace)->setPlatform('local')->run(); $this->expectOutputHtmlContent('This is an example of static file'); }
protected function setUp() { $app = \Staq\App::create($this->projectNamespace)->setPlatform('local'); (new \Stack\Storage\Database\Request())->requireDatabase()->loadMysqlFile($app->getPath('dataset/set.sql')); }
public function test_stack_setting_attribute__overrided_file() { $app = \Staq\App::create($this->projectNamespace)->setPlatform('local'); $stack = new \Stack\Setting\Coco\Des\Bois(); $setting = (new \Stack\Setting())->parse($stack); $this->assertEquals(['three', 'four'], $setting['data.value.list']); }
public function test_exception_class__extending() { $app = \Staq\App::create($this->projectNamespace)->setPlatform('local'); $stack = new \Stack\Exception(); $this->assertTrue(is_a($stack, 'Exception')); }