Пример #1
0
 /**
  * @param \Tonic\Application $app
  * @param \Tonic\Request $request
  */
 function it_should_say_hello_computer($app, $request)
 {
     $app->uri(Argument::any(), Argument::any())->willReturn('/hello');
     $request->getAccept()->willReturn(array('application/json'));
     $request->getContentType()->willReturn('application/json');
     $request->getData()->willReturn(null);
     $request->setData(Argument::any())->willReturn(null);
     $response = $this->exec();
     $response->code->shouldBe(200);
     $response->contentType->shouldBe('application/json');
     $response->body->shouldBe(json_encode(array('hello' => null, 'url' => '/hello')));
 }