Advertisement
Guest User

Untitled

a guest
May 24th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. <?php
  2.  
  3. class EchoTest extends TestCase
  4. {
  5. public function testEcho()
  6. {
  7. $this->json('POST', '/echo', ['string' => "first"]);
  8. $this->json('POST', '/echo', ['string' => "second"]);
  9. $this->json('POST', '/echo', ['string' => "third"]);
  10. }
  11. }
  12.  
  13. <?php
  14.  
  15. namespace AppHttpControllers;
  16.  
  17. use AppHttpControllersController;
  18. use IlluminateSupportFacadesInput;
  19.  
  20. class EchoController extends Controller
  21. {
  22. public function _echo()
  23. {
  24. $input = Input::json()->all();
  25. var_dump($input['string']);
  26. }
  27. }
  28.  
  29. <?php
  30.  
  31. $app->post('echo', ['uses' => 'EchoController@_echo']);
  32.  
  33. .string(5) "first"
  34. string(5) "first"
  35. string(5) "first"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement