Beispiel #1
0
 public function testHeader()
 {
     $this->assertNull($this->instance->header('asdasdas'));
     $this->assertEquals('blub', $this->instance->header('asdasdasd', 'blub'));
     try {
         $this->instance->header([]);
         $this->fail();
     } catch (InvalidArgumentException $e) {
     }
 }
Beispiel #2
0
 /**
  * return void
  */
 protected function registerBuiltInParameters()
 {
     $this->parameter('Hahns\\Request', function () {
         // create request object
         $request = new Request();
         // fill request instance
         foreach ($this->router()->getNamedParameters() as $name => $value) {
             $request->set($name, $value);
         }
         return $request;
     });
     $this->parameter('Hahns\\Hahns', function () {
         return $this;
     });
     $this->parameter('Hahns\\Response\\Json', function () {
         return $this->service('json-response');
     });
     $this->parameter('Hahns\\Response\\Text', function () {
         return $this->service('text-response');
     });
     $this->parameter('Hahns\\Response\\Html', function () {
         return $this->service('html-response');
     });
 }