Exemple #1
0
 /**
  * Test d'un objet response
  */
 public function testResponseRedirect()
 {
     $_SERVER['TEST_RESPONSE'] = true;
     $response = Response::create();
     $response->redirect('/');
     Response::redirect('/');
 }
Exemple #2
0
 /**
  * Permet de tester la création de réponse via la factory
  */
 public function testCreateResponse()
 {
     $response = Response::create();
     $this->assertInstanceOf(ResponseContent::class, $response);
     $response = Response::string('view');
     $this->assertInstanceOf(StringMessage::class, $response->view);
     $response = Response::json(['id' => 1]);
     $this->assertInstanceOf(JsonMessage::class, $response->view);
     $response = Response::text('');
     $this->assertInstanceOf(TextMessage::class, $response->view);
     $response = Response::html('');
     $this->assertInstanceOf(HtmlMessage::class, $response->view);
 }