Esempio 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');
 }
Esempio 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');
 }
 /**
  * @expectedException canisunit\slim\boot\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');
 }
Esempio n. 4
0
 public function testGetData()
 {
     $request = new TestRequest([]);
     $response = $request->get('/test', ['test' => 1]);
     $this->assertEquals(404, $response->getStatusCode());
 }