Ejemplo n.º 1
0
 public function testActionMap()
 {
     $container = [];
     $container['settings'] = ['displayErrorDetails' => true];
     $container['bootstrap'] = ['actions'];
     $container['actions'] = new dummy\ActionMap();
     $request = new TestRequest($container);
     $response = $request->get('/test/alpha');
     $this->assertEquals((string) $response->getBody(), 'perfect');
     $response = $request->get('/test/beta');
     $this->assertEquals((string) $response->getBody(), 'BEFOREgreatAFTER');
 }
Ejemplo n.º 2
0
 public function testControllerMap()
 {
     $container = [];
     $container['settings'] = ['displayErrorDetails' => true];
     $container['bootstrap'] = ['controllers'];
     $container['controllers'] = new dummy\ControllerMap();
     $request = new TestRequest($container);
     $response = $request->get('/alpha/do');
     $this->assertEquals((string) $response->getBody(), 'test');
 }
Ejemplo n.º 3
0
 public function testGetData()
 {
     $request = new TestRequest([]);
     $response = $request->get('/test', ['test' => 1]);
     $this->assertEquals(404, $response->getStatusCode());
 }
 /**
  * @expectedException canisunit\phalcon\engine\dummy\BootstrapBombException
  */
 public function testSubBootstrap()
 {
     $container = [];
     $container['bootstrap'] = ['subcontainer'];
     $container['subcontainer'] = new dummy\Subcontainer();
     $container['subcontainer']['bootstrap'] = ['subbootstrap'];
     $container['subcontainer']['subbootstrap'] = new dummy\BootstrapBomb();
     $container['bootstrap'] = [dummy\BootstrapBomb::class];
     $request = new TestRequest($container);
     $response = $request->get('/test');
 }