NativeSessionHandlerTest.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler;
  11. use PHPUnit\Framework\TestCase;
  12. use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler;
  13. /**
  14. * Test class for NativeSessionHandler.
  15. *
  16. * @author Drak <drak@zikula.org>
  17. *
  18. * @runTestsInSeparateProcesses
  19. * @preserveGlobalState disabled
  20. */
  21. class NativeSessionHandlerTest extends TestCase
  22. {
  23. public function testConstruct()
  24. {
  25. $handler = new NativeSessionHandler();
  26. // note for PHPUnit optimisers - the use of assertTrue/False
  27. // here is deliberate since the tests do not require the classes to exist - drak
  28. if (\PHP_VERSION_ID < 50400) {
  29. $this->assertFalse($handler instanceof \SessionHandler);
  30. $this->assertTrue($handler instanceof NativeSessionHandler);
  31. } else {
  32. $this->assertTrue($handler instanceof \SessionHandler);
  33. $this->assertTrue($handler instanceof NativeSessionHandler);
  34. }
  35. }
  36. }