示例#1
0
 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);
 }
示例#2
0
 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');
 }
示例#3
0
 protected function setUp()
 {
     $app = \Staq\App::create($this->projectNamespace)->setPlatform('local');
 }
示例#4
0
 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');
 }
示例#5
0
 protected function setUp()
 {
     $app = \Staq\App::create($this->projectNamespace)->setPlatform('local');
     (new \Stack\Storage\Database\Request())->requireDatabase()->loadMysqlFile($app->getPath('dataset/set.sql'));
 }
示例#6
0
 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']);
 }
示例#7
0
 public function test_exception_class__extending()
 {
     $app = \Staq\App::create($this->projectNamespace)->setPlatform('local');
     $stack = new \Stack\Exception();
     $this->assertTrue(is_a($stack, 'Exception'));
 }