Exemplo n.º 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);
 }
Exemplo n.º 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');
 }
Exemplo n.º 3
0
 protected function setUp()
 {
     $app = \Staq\App::create($this->projectNamespace)->setPlatform('local');
 }
Exemplo n.º 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');
 }
Exemplo n.º 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'));
 }
Exemplo n.º 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']);
 }
Exemplo n.º 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'));
 }