diff --git a/src/AbstractManager.php b/src/AbstractManager.php index 6f8c9ece..96158e59 100644 --- a/src/AbstractManager.php +++ b/src/AbstractManager.php @@ -56,11 +56,11 @@ abstract class AbstractManager implements Manager /** * Constructor * - * Allow passing a configuration object or class name, a storage object or + * Allow passing a configuration object or class name, a storage object or * class name, or an array of configuration. - * - * @param Configuration $config - * @param Storage $storage + * + * @param Configuration $config + * @param Storage $storage * @param SaveHandler $saveHandler * @return void */ @@ -76,7 +76,7 @@ public function __construct(Configuration $config = null, Storage $storage = nul /** * Set configuration object * - * @param null|Configuration $config + * @param null|Configuration $config * @return void */ public function setOptions(Configuration $config = null) @@ -93,7 +93,7 @@ public function setOptions(Configuration $config = null) /** * Retrieve configuration object - * + * * @return Configuration */ public function getConfig() @@ -104,7 +104,7 @@ public function getConfig() /** * Set session storage object * - * @param null|Storage $storage + * @param null|Storage $storage * @return void */ public function setStorage(Storage $storage = null) @@ -121,7 +121,7 @@ public function setStorage(Storage $storage = null) /** * Retrieve storage object - * + * * @return Storage */ public function getStorage() diff --git a/src/Container.php b/src/Container.php index b5d2222a..1a587980 100644 --- a/src/Container.php +++ b/src/Container.php @@ -18,9 +18,9 @@ /** * Session storage container * - * Allows for interacting with session storage in isolated containers, which - * may have their own expiries, or even expiries per key in the container. - * Additionally, expiries may be absolute TTLs or measured in "hops", which + * Allows for interacting with session storage in isolated containers, which + * may have their own expiries, or even expiries per key in the container. + * Additionally, expiries may be absolute TTLs or measured in "hops", which * are based on how many times the key or container were accessed. * * @category Zend @@ -52,9 +52,9 @@ class Container extends ArrayObject * Constructor * * Provide a name ('Default' if none provided) and a ManagerInterface instance. - * - * @param null|string $name - * @param Manager $manager + * + * @param null|string $name + * @param Manager $manager * @return void */ public function __construct($name = 'Default', Manager $manager = null) @@ -74,8 +74,8 @@ public function __construct($name = 'Default', Manager $manager = null) /** * Set the default ManagerInterface instance to use when none provided to constructor - * - * @param Manager $manager + * + * @param Manager $manager * @return void */ public static function setDefaultManager(Manager $manager = null) @@ -87,7 +87,7 @@ public static function setDefaultManager(Manager $manager = null) * Get the default ManagerInterface instance * * If none provided, instantiates one of type {@link $managerDefaultClass} - * + * * @return Manager * @throws Exception\InvalidArgumentException if invalid manager default class provided */ @@ -105,7 +105,7 @@ public static function getDefaultManager() /** * Get container name - * + * * @return string */ public function getName() @@ -115,7 +115,7 @@ public function getName() /** * Get manager instance - * + * * @return Manager */ public function getManager() @@ -125,8 +125,8 @@ public function getManager() /** * Set session manager - * - * @param null|Manager $manager + * + * @param null|Manager $manager * @return Container */ protected function setManager(Manager $manager = null) @@ -145,7 +145,7 @@ protected function setManager(Manager $manager = null) * Get session storage object * * Proxies to ManagerInterface::getStorage() - * + * * @return Storage */ protected function getStorage() @@ -155,7 +155,7 @@ protected function getStorage() /** * Create a new container object on which to act - * + * * @return ArrayObject */ protected function createContainer() @@ -166,11 +166,11 @@ protected function createContainer() /** * Verify container namespace * - * Checks to see if a container exists within the Storage object already. + * Checks to see if a container exists within the Storage object already. * If not, one is created; if so, checks to see if it's an ArrayObject. - * If not, it raises an exception; otherwise, it returns the Storage + * If not, it raises an exception; otherwise, it returns the Storage * object. - * + * * @param bool $createContainer Whether or not to create the container for the namespace * @return Storage|null Returns null only if $createContainer is false * @throws Exception\RuntimeException @@ -195,8 +195,8 @@ protected function verifyNamespace($createContainer = true) * Determine whether a given key needs to be expired * * Returns true if the key has expired, false otherwise. - * - * @param null|string $key + * + * @param null|string $key * @return bool */ protected function expireKeys($key = null) @@ -223,10 +223,10 @@ protected function expireKeys($key = null) /** * Expire a key by expiry time * - * Checks to see if the entire container has expired based on TTL setting, + * Checks to see if the entire container has expired based on TTL setting, * or the individual key. - * - * @param Storage $storage + * + * @param Storage $storage * @param string $name Container name * @param string $key Key in container to check * @return bool @@ -236,8 +236,8 @@ protected function expireByExpiryTime(Storage $storage, $name, $key) $metadata = $storage->getMetadata($name); // Global container expiry - if (is_array($metadata) - && isset($metadata['EXPIRE']) + if (is_array($metadata) + && isset($metadata['EXPIRE']) && ($_SERVER['REQUEST_TIME'] > $metadata['EXPIRE']) ) { unset($metadata['EXPIRE']); @@ -248,9 +248,9 @@ protected function expireByExpiryTime(Storage $storage, $name, $key) // Expire individual key if ((null !== $key) - && is_array($metadata) - && isset($metadata['EXPIRE_KEYS']) - && isset($metadata['EXPIRE_KEYS'][$key]) + && is_array($metadata) + && isset($metadata['EXPIRE_KEYS']) + && isset($metadata['EXPIRE_KEYS'][$key]) && ($_SERVER['REQUEST_TIME'] > $metadata['EXPIRE_KEYS'][$key]) ) { unset($metadata['EXPIRE_KEYS'][$key]); @@ -261,8 +261,8 @@ protected function expireByExpiryTime(Storage $storage, $name, $key) // Find any keys that have expired if ((null === $key) - && is_array($metadata) - && isset($metadata['EXPIRE_KEYS']) + && is_array($metadata) + && isset($metadata['EXPIRE_KEYS']) ) { foreach (array_keys($metadata['EXPIRE_KEYS']) as $key) { if ($_SERVER['REQUEST_TIME'] > $metadata['EXPIRE_KEYS'][$key]) { @@ -282,12 +282,12 @@ protected function expireByExpiryTime(Storage $storage, $name, $key) /** * Expire key by session hops * - * Determines whether the container or an individual key within it has + * Determines whether the container or an individual key within it has * expired based on session hops - * - * @param Storage $storage - * @param string $name - * @param string $key + * + * @param Storage $storage + * @param string $name + * @param string $key * @return bool */ protected function expireByHops(Storage $storage, $name, $key) @@ -296,8 +296,8 @@ protected function expireByHops(Storage $storage, $name, $key) $metadata = $storage->getMetadata($name); // Global container expiry - if (is_array($metadata) - && isset($metadata['EXPIRE_HOPS']) + if (is_array($metadata) + && isset($metadata['EXPIRE_HOPS']) && ($ts > $metadata['EXPIRE_HOPS']['ts']) ) { $metadata['EXPIRE_HOPS']['hops']--; @@ -314,9 +314,9 @@ protected function expireByHops(Storage $storage, $name, $key) // Single key expiry if ((null !== $key) - && is_array($metadata) - && isset($metadata['EXPIRE_HOPS_KEYS']) - && isset($metadata['EXPIRE_HOPS_KEYS'][$key]) + && is_array($metadata) + && isset($metadata['EXPIRE_HOPS_KEYS']) + && isset($metadata['EXPIRE_HOPS_KEYS'][$key]) && ($ts > $metadata['EXPIRE_HOPS_KEYS'][$key]['ts']) ) { $metadata['EXPIRE_HOPS_KEYS'][$key]['hops']--; @@ -333,8 +333,8 @@ protected function expireByHops(Storage $storage, $name, $key) // Find all expired keys if ((null === $key) - && is_array($metadata) - && isset($metadata['EXPIRE_HOPS_KEYS']) + && is_array($metadata) + && isset($metadata['EXPIRE_HOPS_KEYS']) ) { foreach (array_keys($metadata['EXPIRE_HOPS_KEYS']) as $key) { if ($ts > $metadata['EXPIRE_HOPS_KEYS'][$key]['ts']) { @@ -357,9 +357,9 @@ protected function expireByHops(Storage $storage, $name, $key) /** * Store a value within the container - * - * @param string $key - * @param mixed $value + * + * @param string $key + * @param mixed $value * @return void */ public function offsetSet($key, $value) @@ -372,8 +372,8 @@ public function offsetSet($key, $value) /** * Determine if the key exists - * - * @param string $key + * + * @param string $key * @return bool */ public function offsetExists($key) @@ -395,8 +395,8 @@ public function offsetExists($key) /** * Retrieve a specific key in the container - * - * @param string $key + * + * @param string $key * @return mixed */ public function offsetGet($key) @@ -411,8 +411,8 @@ public function offsetGet($key) /** * Unset a single key in the container - * - * @param string $key + * + * @param string $key * @return void */ public function offsetUnset($key) @@ -427,7 +427,7 @@ public function offsetUnset($key) /** * Iterate over session container - * + * * @return Iterator */ public function getIterator() @@ -442,9 +442,9 @@ public function getIterator() * Set expiration TTL * * Set the TTL for the entire container, a single key, or a set of keys. - * + * * @param int $ttl TTL in seconds - * @param null|string|array $vars + * @param null|string|array $vars * @return Container */ public function setExpirationSeconds($ttl, $vars = null) @@ -479,7 +479,7 @@ public function setExpirationSeconds($ttl, $vars = null) } $storage->setMetadata( - $this->getName(), + $this->getName(), $data ); return $this; @@ -487,9 +487,9 @@ public function setExpirationSeconds($ttl, $vars = null) /** * Set expiration hops for the container, a single key, or set of keys - * - * @param int $hops - * @param null|string|array $vars + * + * @param int $hops + * @param null|string|array $vars * @return Container */ public function setExpirationHops($hops, $vars = null) @@ -525,7 +525,7 @@ public function setExpirationHops($hops, $vars = null) } $storage->setMetadata( - $this->getName(), + $this->getName(), $data ); return $this; diff --git a/src/ManagerInterface.php b/src/ManagerInterface.php index 06a458c1..ef9ccabf 100644 --- a/src/ManagerInterface.php +++ b/src/ManagerInterface.php @@ -28,7 +28,7 @@ public function __construct(Configuration $config = null, Storage $storage = nul public function getConfig(); public function getStorage(); public function getSaveHandler(); - + public function sessionExists(); public function start(); public function destroy(); diff --git a/src/SaveHandler/DbTableGatewayOptions.php b/src/SaveHandler/DbTableGatewayOptions.php index 99f35385..6e13bd3b 100644 --- a/src/SaveHandler/DbTableGatewayOptions.php +++ b/src/SaveHandler/DbTableGatewayOptions.php @@ -145,7 +145,7 @@ public function getModifiedColumn() /** * Set Modified Column - * + * * @param string $modifiedColumn * @return DbTableGatewayOptions * @throws Exception\InvalidArgumentException diff --git a/src/Storage/ArrayStorage.php b/src/Storage/ArrayStorage.php index 7c525114..8141ea17 100644 --- a/src/Storage/ArrayStorage.php +++ b/src/Storage/ArrayStorage.php @@ -16,7 +16,7 @@ /** * Array session storage * - * Defines an ArrayObject interface for accessing session storage, with options + * Defines an ArrayObject interface for accessing session storage, with options * for setting metadata, locking, and marking as immutable. * * @category Zend @@ -36,10 +36,10 @@ class ArrayStorage extends ArrayObject implements StorageInterface * * Instantiates storage as an ArrayObject, allowing property access. * Also sets the initial request access time. - * - * @param array|ArrayAccess $input - * @param int $flags - * @param string $iteratorClass + * + * @param array|ArrayAccess $input + * @param int $flags + * @param string $iteratorClass * @return void */ public function __construct($input = array(), $flags = \ArrayObject::ARRAY_AS_PROPS, $iteratorClass = '\\ArrayIterator') @@ -50,7 +50,7 @@ public function __construct($input = array(), $flags = \ArrayObject::ARRAY_AS_PR /** * Retrieve the request access time - * + * * @return int */ public function getRequestAccessTime() @@ -61,11 +61,11 @@ public function getRequestAccessTime() /** * Set a value in the storage object * - * If the object is marked as immutable, or the object or key is marked as + * If the object is marked as immutable, or the object or key is marked as * locked, raises an exception. - * - * @param string $key - * @param mixed $value + * + * @param string $key + * @param mixed $value * @return void */ public function offsetSet($key, $value) @@ -82,7 +82,7 @@ public function offsetSet($key, $value) /** * Lock this storage instance, or a key within it * - * @param null|int|string $key + * @param null|int|string $key * @return ArrayStorage */ public function lock($key = null) @@ -100,8 +100,8 @@ public function lock($key = null) /** * Is the object or key marked as locked? - * - * @param null|int|string $key + * + * @param null|int|string $key * @return bool */ public function isLocked($key = null) @@ -135,8 +135,8 @@ public function isLocked($key = null) /** * Unlock an object or key marked as locked - * - * @param null|int|string $key + * + * @param null|int|string $key * @return ArrayStorage */ public function unlock($key = null) @@ -168,7 +168,7 @@ public function unlock($key = null) /** * Mark the storage container as immutable - * + * * @return ArrayStorage */ public function markImmutable() @@ -179,7 +179,7 @@ public function markImmutable() /** * Is the storage container marked as immutable? - * + * * @return bool */ public function isImmutable() @@ -196,9 +196,9 @@ public function isImmutable() * - Maintaining access counts * - localizing session storage * - etc. - * - * @param string $key - * @param mixed $value + * + * @param string $key + * @param mixed $value * @param bool $overwriteArray Whether to overwrite or merge array values; by default, merges * @return ArrayStorage */ @@ -220,7 +220,7 @@ public function setMetadata($key, $value, $overwriteArray = false) } else { if ((null === $value) && isset($this['__ZF'][$key])) { // unset($this['__ZF'][$key]) led to "indirect modification... - // has no effect" errors, so explicitly pulling array and + // has no effect" errors, so explicitly pulling array and // unsetting key. $array = $this['__ZF']; unset($array[$key]); @@ -237,10 +237,10 @@ public function setMetadata($key, $value, $overwriteArray = false) /** * Retrieve metadata for the storage object or a specific metadata key * - * Returns false if no metadata stored, or no metadata exists for the given + * Returns false if no metadata stored, or no metadata exists for the given * key. - * - * @param null|int|string $key + * + * @param null|int|string $key * @return mixed */ public function getMetadata($key = null) @@ -262,8 +262,8 @@ public function getMetadata($key = null) /** * Clear the storage object or a subkey of the object - * - * @param null|int|string $key + * + * @param null|int|string $key * @return ArrayStorage */ public function clear($key = null) @@ -294,7 +294,7 @@ public function clear($key = null) * Cast the object to an array * * Returns data only, no metadata. - * + * * @return array */ public function toArray() @@ -310,8 +310,8 @@ public function toArray() * Load the storage from another array * * Overwrites any data that was previously set. - * - * @param array $array + * + * @param array $array * @return ArrayStorage */ public function fromArray(array $array) diff --git a/src/Storage/SessionStorage.php b/src/Storage/SessionStorage.php index cc2cb9b9..9e5902fd 100644 --- a/src/Storage/SessionStorage.php +++ b/src/Storage/SessionStorage.php @@ -13,9 +13,9 @@ /** * Session storage in $_SESSION * - * Replaces the $_SESSION superglobal with an ArrayObject that allows for + * Replaces the $_SESSION superglobal with an ArrayObject that allows for * property access, metadata storage, locking, and immutability. - * + * * @category Zend * @package Zend_Session * @subpackage Storage @@ -25,12 +25,12 @@ class SessionStorage extends ArrayStorage /** * Constructor * - * Sets the $_SESSION superglobal to an ArrayObject, maintaining previous + * Sets the $_SESSION superglobal to an ArrayObject, maintaining previous * values if any discovered. - * - * @param null|array|ArrayAccess $input - * @param int $flags - * @param string $iteratorClass + * + * @param null|array|ArrayAccess $input + * @param int $flags + * @param string $iteratorClass * @return void */ public function __construct($input = null, $flags = \ArrayObject::ARRAY_AS_PROPS, $iteratorClass = '\\ArrayIterator') @@ -55,9 +55,9 @@ public function __construct($input = null, $flags = \ArrayObject::ARRAY_AS_PROPS /** * Destructor * - * Resets $_SESSION superglobal to an array, by casting object using + * Resets $_SESSION superglobal to an array, by casting object using * getArrayCopy(). - * + * * @return void */ public function __destruct() @@ -69,8 +69,8 @@ public function __destruct() * Load session object from an existing array * * Ensures $_SESSION is set to an instance of the object when complete. - * - * @param array $array + * + * @param array $array * @return SessionStorage */ public function fromArray(array $array) @@ -84,7 +84,7 @@ public function fromArray(array $array) /** * Mark object as immutable - * + * * @return void */ public function markImmutable() @@ -94,7 +94,7 @@ public function markImmutable() /** * Determine if this object is immutable - * + * * @return bool */ public function isImmutable() diff --git a/src/Storage/StorageInterface.php b/src/Storage/StorageInterface.php index 52417f62..6f5f782a 100644 --- a/src/Storage/StorageInterface.php +++ b/src/Storage/StorageInterface.php @@ -18,7 +18,7 @@ /** * Session storage interface * - * Defines the minimum requirements for handling userland, in-script session + * Defines the minimum requirements for handling userland, in-script session * storage (e.g., the $_SESSION superglobal array). * * @category Zend diff --git a/src/Validator/HttpUserAgent.php b/src/Validator/HttpUserAgent.php index 17119455..05810520 100644 --- a/src/Validator/HttpUserAgent.php +++ b/src/Validator/HttpUserAgent.php @@ -42,7 +42,7 @@ public function __construct($data = null) public function isValid() { $userAgent = isset($_SERVER['HTTP_USER_AGENT']) - ? $_SERVER['HTTP_USER_AGENT'] + ? $_SERVER['HTTP_USER_AGENT'] : null; return $userAgent === $this->getData(); @@ -50,7 +50,7 @@ public function isValid() /** * Retrieve token for validating call - * + * * @return string */ public function getData() @@ -60,7 +60,7 @@ public function getData() /** * Return validator name - * + * * @return string */ public function getName() diff --git a/src/Validator/ValidatorInterface.php b/src/Validator/ValidatorInterface.php index bd72f00f..8bd42014 100644 --- a/src/Validator/ValidatorInterface.php +++ b/src/Validator/ValidatorInterface.php @@ -29,14 +29,14 @@ public function isValid(); /** * Get data from validator to be used for validation comparisons - * + * * @return mixed */ public function getData(); /** * Get validator name for use with storing validators between requests - * + * * @return string */ public function getName(); diff --git a/src/ValidatorChain.php b/src/ValidatorChain.php index 221aa07f..01e84728 100644 --- a/src/ValidatorChain.php +++ b/src/ValidatorChain.php @@ -31,8 +31,8 @@ class ValidatorChain extends EventManager * Construct the validation chain * * Retrieves validators from session storage and attaches them. - * - * @param Storage $storage + * + * @param Storage $storage * @return void */ public function __construct(Storage $storage) @@ -49,10 +49,10 @@ public function __construct(Storage $storage) /** * Attach a listener to the session validator chain - * + * * @param string $event * @param callback $callback - * @param int $priority + * @param int $priority * @return \Zend\Stdlib\CallbackHandler */ public function attach($event, $callback = null, $priority = 1) @@ -79,7 +79,7 @@ public function attach($event, $callback = null, $priority = 1) /** * Retrieve session storage object - * + * * @return Storage */ public function getStorage() diff --git a/test/ContainerTest.php b/test/ContainerTest.php index bec5fc7d..1caeae7e 100644 --- a/test/ContainerTest.php +++ b/test/ContainerTest.php @@ -10,10 +10,10 @@ namespace ZendTest\Session; -use Zend\Session\Container, - Zend\Session\Configuration\StandardConfiguration, - Zend\Session\ManagerInterface as Manager, - Zend\Session; +use Zend\Session\Container; +use Zend\Session\Configuration\StandardConfiguration; +use Zend\Session\ManagerInterface as Manager; +use Zend\Session; /** * @category Zend @@ -87,13 +87,13 @@ public function testUsingOldZF1NameIsStillValid() $container = new Container('Zend_Foo', $this->manager); $this->assertEquals('Zend_Foo', $container->getName()); } - + public function testUsingNewZF2NamespaceIsValid() { $container = new Container('Zend\Foo', $this->manager); $this->assertEquals('Zend\Foo', $container->getName()); } - + public function testPassingInvalidNameToConstructorRaisesException() { $tries = array( @@ -302,7 +302,7 @@ public function testSettingExpirationHopsWithNoVariablesMarksContainerByWritingT $metadata = $storage->getMetadata('Default'); $this->assertTrue(array_key_exists('EXPIRE_HOPS', $metadata)); $this->assertEquals( - array('hops' => 2, 'ts' => $storage->getRequestAccessTime()), + array('hops' => 2, 'ts' => $storage->getRequestAccessTime()), $metadata['EXPIRE_HOPS'] ); } @@ -316,7 +316,7 @@ public function testSettingExpirationHopsWithSingleKeyMarksContainerByWritingToS $this->assertTrue(array_key_exists('EXPIRE_HOPS_KEYS', $metadata)); $this->assertTrue(array_key_exists('foo', $metadata['EXPIRE_HOPS_KEYS'])); $this->assertEquals( - array('hops' => 2, 'ts' => $storage->getRequestAccessTime()), + array('hops' => 2, 'ts' => $storage->getRequestAccessTime()), $metadata['EXPIRE_HOPS_KEYS']['foo'] ); } @@ -335,11 +335,11 @@ public function testSettingExpirationHopsWithMultipleKeysMarksContainerByWriting $ts = $storage->getRequestAccessTime(); $expected = array( 'foo' => array( - 'hops' => 2, + 'hops' => 2, 'ts' => $ts, ), 'baz' => array( - 'hops' => 2, + 'hops' => 2, 'ts' => $ts, ), ); diff --git a/test/SaveHandler/CacheTest.php b/test/SaveHandler/CacheTest.php index fa4b1a67..56e0ec98 100644 --- a/test/SaveHandler/CacheTest.php +++ b/test/SaveHandler/CacheTest.php @@ -10,10 +10,10 @@ namespace ZendTest\Session\SaveHandler; -use Zend\Session\SaveHandler\Cache, - Zend\Session\ManagerInterface as Manager, - Zend\Cache\StorageFactory as CacheFactory, - Zend\Cache\Storage\Adapter\AdapterInterface as CacheAdapter; +use Zend\Session\SaveHandler\Cache; +use Zend\Session\ManagerInterface as Manager; +use Zend\Cache\StorageFactory as CacheFactory; +use Zend\Cache\Storage\Adapter\AdapterInterface as CacheAdapter; /** * Unit testing for DbTable include all tests for diff --git a/test/SessionManagerTest.php b/test/SessionManagerTest.php index f4a5b800..aec61415 100644 --- a/test/SessionManagerTest.php +++ b/test/SessionManagerTest.php @@ -10,8 +10,8 @@ namespace ZendTest\Session; -use Zend\Session\SessionManager, - Zend\Session; +use Zend\Session\SessionManager; +use Zend\Session; /** * @category Zend @@ -242,7 +242,7 @@ public function testDestroyByDefaultSendsAnExpireCookie() if (!extension_loaded('xdebug')) { $this->markTestSkipped('Xdebug required for this test'); } - + $config = $this->manager->getConfig(); $config->setUseCookies(true); $this->manager->start(); @@ -267,7 +267,7 @@ public function testSendingFalseToSendExpireCookieWhenCallingDestroyShouldNotSen if (!extension_loaded('xdebug')) { $this->markTestSkipped('Xdebug required for this test'); } - + $config = $this->manager->getConfig(); $config->setUseCookies(true); $this->manager->start(); @@ -374,7 +374,7 @@ public function testSettingIdAfterSessionStartedShouldSendExpireCookie() if (!extension_loaded('xdebug')) { $this->markTestSkipped('Xdebug required for this test'); } - + $config = $this->manager->getConfig(); $config->setUseCookies(true); $this->manager->start(); @@ -410,7 +410,7 @@ public function testRegeneratingIdAfterSessionStartedShouldSendExpireCookie() if (!extension_loaded('xdebug')) { $this->markTestSkipped('Xdebug required for this test'); } - + $config = $this->manager->getConfig(); $config->setUseCookies(true); $this->manager->start(); @@ -435,7 +435,7 @@ public function testRememberMeShouldSendNewSessionCookieWithUpdatedTimestamp() if (!extension_loaded('xdebug')) { $this->markTestSkipped('Xdebug required for this test'); } - + $config = $this->manager->getConfig(); $config->setUseCookies(true); $this->manager->start(); @@ -466,7 +466,7 @@ public function testRememberMeShouldSetTimestampBasedOnConfigurationByDefault() if (!extension_loaded('xdebug')) { $this->markTestSkipped('Xdebug required for this test'); } - + $config = $this->manager->getConfig(); $config->setUseCookies(true); $config->setRememberMeSeconds(3600); @@ -501,7 +501,7 @@ public function testForgetMeShouldSendCookieWithZeroTimestamp() if (!extension_loaded('xdebug')) { $this->markTestSkipped('Xdebug required for this test'); } - + $config = $this->manager->getConfig(); $config->setUseCookies(true); $this->manager->start(); diff --git a/test/SessionStorageTest.php b/test/SessionStorageTest.php index 52badb58..4c731541 100644 --- a/test/SessionStorageTest.php +++ b/test/SessionStorageTest.php @@ -10,8 +10,8 @@ namespace ZendTest\Session; -use Zend\Session\Storage\SessionStorage, - Zend\Session\Storage\ArrayStorage; +use Zend\Session\Storage\SessionStorage; +use Zend\Session\Storage\ArrayStorage; /** * @category Zend diff --git a/test/StandardConfigurationTest.php b/test/StandardConfigurationTest.php index 084260df..11d48364 100644 --- a/test/StandardConfigurationTest.php +++ b/test/StandardConfigurationTest.php @@ -67,13 +67,13 @@ public function testSettingInvalidGcProbabilityRaisesException() $this->setExpectedException('Zend\Session\Exception\InvalidArgumentException', 'Invalid gc_probability; must be numeric'); $this->config->setGcProbability('foobar_bogus'); } - + public function testSettingInvalidGcProbabilityRaisesException2() { $this->setExpectedException('Zend\Session\Exception\InvalidArgumentException', 'Invalid gc_probability; must be a percentage'); $this->config->setGcProbability(-1); } - + public function testSettingInvalidGcProbabilityRaisesException3() { $this->setExpectedException('Zend\Session\Exception\InvalidArgumentException', 'Invalid gc_probability; must be a percentage'); @@ -113,7 +113,7 @@ public function testSettingInvalidGcMaxlifetimeRaisesException() $this->setExpectedException('Zend\Session\Exception\InvalidArgumentException', 'Invalid gc_maxlifetime; must be numeric'); $this->config->setGcMaxlifetime('foobar_bogus'); } - + public function testSettingInvalidGcMaxlifetimeRaisesException2() { $this->setExpectedException('Zend\Session\Exception\InvalidArgumentException', 'Invalid gc_maxlifetime; must be a positive integer'); @@ -148,7 +148,7 @@ public function testSettingInvalidCookieLifetimeRaisesException() $this->setExpectedException('Zend\Session\Exception\InvalidArgumentException', 'Invalid cookie_lifetime; must be numeric'); $this->config->setCookieLifetime('foobar_bogus'); } - + public function testSettingInvalidCookieLifetimeRaisesException2() { $this->setExpectedException('Zend\Session\Exception\InvalidArgumentException', 'Invalid cookie_lifetime; must be a positive integer or zero'); @@ -168,13 +168,13 @@ public function testSettingInvalidCookiePathRaisesException() $this->setExpectedException('Zend\Session\Exception\InvalidArgumentException', 'Invalid cookie path'); $this->config->setCookiePath(24); } - + public function testSettingInvalidCookiePathRaisesException2() { $this->setExpectedException('Zend\Session\Exception\InvalidArgumentException', 'Invalid cookie path'); $this->config->setCookiePath('foo'); } - + public function testSettingInvalidCookiePathRaisesException3() { $this->setExpectedException('Zend\Session\Exception\InvalidArgumentException', 'Invalid cookie path'); @@ -200,7 +200,7 @@ public function testSettingInvalidCookieDomainRaisesException() $this->setExpectedException('Zend\Session\Exception\InvalidArgumentException', 'Invalid cookie domain: must be a string'); $this->config->setCookieDomain(24); } - + public function testSettingInvalidCookieDomainRaisesException2() { $this->setExpectedException('Zend\Session\Exception\InvalidArgumentException', 'does not match the expected structure for a DNS hostname'); @@ -292,7 +292,7 @@ public function testSettingInvalidEntropyLengthRaisesException() $this->setExpectedException('Zend\Session\Exception\InvalidArgumentException', 'Invalid entropy_length; must be numeric'); $this->config->setEntropyLength('foobar_bogus'); } - + public function testSettingInvalidEntropyLengthRaisesException2() { $this->setExpectedException('Zend\Session\Exception\InvalidArgumentException', 'Invalid entropy_length; must be a positive integer or zero'); @@ -333,7 +333,7 @@ public function testSettingInvalidCacheExpireRaisesException() $this->setExpectedException('Zend\Session\Exception\InvalidArgumentException', 'Invalid cache_expire; must be numeric'); $this->config->setCacheExpire('foobar_bogus'); } - + public function testSettingInvalidCacheExpireRaisesException2() { $this->setExpectedException('Zend\Session\Exception\InvalidArgumentException', 'Invalid cache_expire; must be a positive integer'); @@ -416,7 +416,7 @@ public function testSettingInvalidRememberMeSecondsRaisesException() $this->setExpectedException('Zend\Session\Exception\InvalidArgumentException', 'Invalid remember_me_seconds; must be numeric'); $this->config->setRememberMeSeconds('foobar_bogus'); } - + public function testSettingInvalidRememberMeSecondsRaisesException2() { $this->setExpectedException('Zend\Session\Exception\InvalidArgumentException', 'Invalid remember_me_seconds; must be a positive integer'); diff --git a/test/StorageTest.php b/test/StorageTest.php index 79ac60a0..dab3fe62 100644 --- a/test/StorageTest.php +++ b/test/StorageTest.php @@ -87,7 +87,7 @@ public function testLockWithKeyMakesOnlyThatKeyReadOnly() { $this->storage->foo = 'bar'; $this->storage->lock('foo'); - + $this->storage->bar = 'baz'; $this->assertEquals('baz', $this->storage->bar); diff --git a/test/TestAsset/TestManager.php b/test/TestAsset/TestManager.php index 7823cc8f..ec54f439 100644 --- a/test/TestAsset/TestManager.php +++ b/test/TestAsset/TestManager.php @@ -10,11 +10,11 @@ namespace ZendTest\Session\TestAsset; -use Zend\EventManager\EventManagerInterface, - Zend\Session\AbstractManager, - Zend\Session\Configuration\ConfigurationInterface as SessionConfiguration, - Zend\Session\SaveHandler\SaveHandlerInterface as SessionSaveHandler, - Zend\Session\Storage\StorageInterface as SessionStorage; +use Zend\EventManager\EventManagerInterface; +use Zend\Session\AbstractManager; +use Zend\Session\Configuration\ConfigurationInterface as SessionConfiguration; +use Zend\Session\SaveHandler\SaveHandlerInterface as SessionSaveHandler; +use Zend\Session\Storage\StorageInterface as SessionStorage; class TestManager extends AbstractManager {