Overview

Namespaces

  • Composer
    • Autoload
  • Guzzle
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
        • Header
      • QueryAggregator
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Mock
    • Stream
  • Mockery
    • Adapter
      • Phpunit
    • CountValidator
    • Exception
    • Generator
      • StringManipulation
        • Pass
    • Loader
    • Matcher
  • None
  • Omnipay
    • Common
      • Exception
      • Message
    • Dummy
      • Message
    • Fatzebra
      • Message
  • PHP
  • Symfony
    • Component
      • EventDispatcher
        • Debug
        • DependencyInjection
        • Tests
          • Debug
          • DependencyInjection
      • HttpFoundation
        • File
          • Exception
          • MimeType
        • Session
          • Attribute
          • Flash
          • Storage
            • Handler
            • Proxy
        • Tests
          • File
            • MimeType
          • Session
            • Attribute
            • Flash
            • Storage
              • Handler
              • Proxy
      • Yaml
        • Exception
        • Tests

Classes

  • Symfony\Component\Yaml\Tests\A
  • Symfony\Component\Yaml\Tests\B
  • Symfony\Component\Yaml\Tests\DumperTest
  • Symfony\Component\Yaml\Tests\InlineTest
  • Symfony\Component\Yaml\Tests\ParseExceptionTest
  • Symfony\Component\Yaml\Tests\ParserTest
  • Symfony\Component\Yaml\Tests\YamlTest
  • Overview
  • Namespace
  • Function
  • Tree
 1: <?php
 2: 
 3: /*
 4:  * This file is part of the Symfony package.
 5:  *
 6:  * (c) Fabien Potencier <fabien@symfony.com>
 7:  *
 8:  * For the full copyright and license information, please view the LICENSE
 9:  * file that was distributed with this source code.
10:  */
11: 
12: namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler;
13: 
14: use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler;
15: use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
16: 
17: /**
18:  * Test class for NativeFileSessionHandler.
19:  *
20:  * @author Drak <drak@zikula.org>
21:  *
22:  * @runTestsInSeparateProcesses
23:  * @preserveGlobalState disabled
24:  */
25: class NativeFileSessionHandlerTest extends \PHPUnit_Framework_TestCase
26: {
27:     public function testConstruct()
28:     {
29:         $storage = new NativeSessionStorage(array('name' => 'TESTING'), new NativeFileSessionHandler(sys_get_temp_dir()));
30: 
31:         if (PHP_VERSION_ID < 50400) {
32:             $this->assertEquals('files', $storage->getSaveHandler()->getSaveHandlerName());
33:             $this->assertEquals('files', ini_get('session.save_handler'));
34:         } else {
35:             $this->assertEquals('files', $storage->getSaveHandler()->getSaveHandlerName());
36:             $this->assertEquals('user', ini_get('session.save_handler'));
37:         }
38: 
39:         $this->assertEquals(sys_get_temp_dir(), ini_get('session.save_path'));
40:         $this->assertEquals('TESTING', ini_get('session.name'));
41:     }
42: 
43:     /**
44:      * @dataProvider savePathDataProvider
45:      */
46:     public function testConstructSavePath($savePath, $expectedSavePath, $path)
47:     {
48:         $handler = new NativeFileSessionHandler($savePath);
49:         $this->assertEquals($expectedSavePath, ini_get('session.save_path'));
50:         $this->assertTrue(is_dir(realpath($path)));
51: 
52:         rmdir($path);
53:     }
54: 
55:     public function savePathDataProvider()
56:     {
57:         $base = sys_get_temp_dir();
58: 
59:         return array(
60:             array("$base/foo", "$base/foo", "$base/foo"),
61:             array("5;$base/foo", "5;$base/foo", "$base/foo"),
62:             array("5;0600;$base/foo", "5;0600;$base/foo", "$base/foo"),
63:         );
64:     }
65: 
66:     /**
67:      * @expectedException \InvalidArgumentException
68:      */
69:     public function testConstructException()
70:     {
71:         $handler = new NativeFileSessionHandler('something;invalid;with;too-many-args');
72:     }
73: 
74:     public function testConstructDefault()
75:     {
76:         $path = ini_get('session.save_path');
77:         $storage = new NativeSessionStorage(array('name' => 'TESTING'), new NativeFileSessionHandler());
78: 
79:         $this->assertEquals($path, ini_get('session.save_path'));
80:     }
81: }
82: 
Omnipay Fat Zebra / Paystream Gateway Module API Documentation API documentation generated by ApiGen