You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
754 B

  1. <?php
  2. namespace Tests\Feature;
  3. use Tests\TestCase;
  4. class UserTest extends TestCase
  5. {
  6. /**
  7. * A basic test example.
  8. *
  9. * @return void
  10. */
  11. public function testExample()
  12. {
  13. $this->assertTrue(true);
  14. }
  15. /**
  16. * A basic test example.
  17. *
  18. * @return void
  19. */
  20. public function testRedis()
  21. {
  22. // Retrieve a piece of data from the session...
  23. $value = session('key');
  24. // Specifying a default value...
  25. $value = session('key', 'default');
  26. $this->assertEquals('default', session('key', 'default'));
  27. // Store a piece of data in the session...
  28. session(['key' => 'value']);
  29. $this->assertEquals('value', session('key', 'default'));
  30. }
  31. }