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\Proxy;
 13: 
 14: use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy;
 15: 
 16: /**
 17:  * Tests for SessionHandlerProxy class.
 18:  *
 19:  * @author Drak <drak@zikula.org>
 20:  *
 21:  * @runTestsInSeparateProcesses
 22:  * @preserveGlobalState disabled
 23:  */
 24: class SessionHandlerProxyTest extends \PHPUnit_Framework_TestCase
 25: {
 26:     /**
 27:      * @var \PHPUnit_Framework_MockObject_Matcher
 28:      */
 29:     private $mock;
 30: 
 31:     /**
 32:      * @var SessionHandlerProxy
 33:      */
 34:     private $proxy;
 35: 
 36:     protected function setUp()
 37:     {
 38:         $this->mock = $this->getMock('SessionHandlerInterface');
 39:         $this->proxy = new SessionHandlerProxy($this->mock);
 40:     }
 41: 
 42:     protected function tearDown()
 43:     {
 44:         $this->mock = null;
 45:         $this->proxy = null;
 46:     }
 47: 
 48:     public function testOpen()
 49:     {
 50:         $this->mock->expects($this->once())
 51:             ->method('open')
 52:             ->will($this->returnValue(true));
 53: 
 54:         $this->assertFalse($this->proxy->isActive());
 55:         $this->proxy->open('name', 'id');
 56:         if (PHP_VERSION_ID < 50400) {
 57:             $this->assertTrue($this->proxy->isActive());
 58:         } else {
 59:             $this->assertFalse($this->proxy->isActive());
 60:         }
 61:     }
 62: 
 63:     public function testOpenFalse()
 64:     {
 65:         $this->mock->expects($this->once())
 66:             ->method('open')
 67:             ->will($this->returnValue(false));
 68: 
 69:         $this->assertFalse($this->proxy->isActive());
 70:         $this->proxy->open('name', 'id');
 71:         $this->assertFalse($this->proxy->isActive());
 72:     }
 73: 
 74:     public function testClose()
 75:     {
 76:         $this->mock->expects($this->once())
 77:             ->method('close')
 78:             ->will($this->returnValue(true));
 79: 
 80:         $this->assertFalse($this->proxy->isActive());
 81:         $this->proxy->close();
 82:         $this->assertFalse($this->proxy->isActive());
 83:     }
 84: 
 85:     public function testCloseFalse()
 86:     {
 87:         $this->mock->expects($this->once())
 88:             ->method('close')
 89:             ->will($this->returnValue(false));
 90: 
 91:         $this->assertFalse($this->proxy->isActive());
 92:         $this->proxy->close();
 93:         $this->assertFalse($this->proxy->isActive());
 94:     }
 95: 
 96:     public function testRead()
 97:     {
 98:         $this->mock->expects($this->once())
 99:             ->method('read');
100: 
101:         $this->proxy->read('id');
102:     }
103: 
104:     public function testWrite()
105:     {
106:         $this->mock->expects($this->once())
107:             ->method('write');
108: 
109:         $this->proxy->write('id', 'data');
110:     }
111: 
112:     public function testDestroy()
113:     {
114:         $this->mock->expects($this->once())
115:             ->method('destroy');
116: 
117:         $this->proxy->destroy('id');
118:     }
119: 
120:     public function testGc()
121:     {
122:         $this->mock->expects($this->once())
123:             ->method('gc');
124: 
125:         $this->proxy->gc(86400);
126:     }
127: }
128: 
Omnipay Fat Zebra / Paystream Gateway Module API Documentation API documentation generated by ApiGen