Permalink
Browse files

Resolved version_compare issue, debian packages im looking at you; co…

…ntainer to allow traversable added new test to test old behavior
  • Loading branch information...
1 parent 469972c commit 8682fbae72fe6a973499a51eb808552a3a3c5297 @mwillbanks committed Feb 7, 2013
@@ -198,7 +198,7 @@ protected function verifyNamespace($createContainer = true)
}
$storage[$name] = $this->createContainer();
}
- if (!is_array($storage[$name]) && !$storage[$name] instanceof ArrayObject) {
+ if (!is_array($storage[$name]) && !$storage[$name] instanceof Traversable) {
throw new Exception\RuntimeException('Container cannot write to storage due to type mismatch');
}
@@ -1,5 +1,5 @@
<?php
-if (version_compare(PHP_VERSION, '5.3.3', 'le')) {
+if (version_compare(PHP_VERSION, '5.3.4', 'lt')) {
require_once __DIR__ . '/Container.php';
require_once __DIR__ . '/Storage/SessionArrayStorage.php';
}
@@ -1,4 +1,4 @@
<?php
-if (version_compare(PHP_VERSION, '5.3.3', 'le')) {
+if (version_compare(PHP_VERSION, '5.3.4', 'lt')) {
require_once __DIR__ . '/ArrayObject.php';
}
@@ -529,11 +529,22 @@ public function testExchangeArray()
public function testMultiDimensionalUnset()
{
- if (version_compare(PHP_VERSION, '5.3.3') <= 0) {
- $this->markTestSkipped('Known issue on versions of PHP 5.3.3 or less');
+ if (version_compare(PHP_VERSION, '5.3.4') < 0) {
+ $this->markTestSkipped('Known issue on versions of PHP less than 5.3.4');
}
$this->container->foo = array('bar' => 'baz');
unset($this->container['foo']['bar']);
$this->assertSame(array(), $this->container->foo);
}
+
+ public function testUpgradeBehaviors()
+ {
+ $storage = $this->manager->getStorage();
+ $storage['foo'] = new \ArrayObject(array('bar' => 'baz'));
+
+ $container = new Container('foo', $this->manager);
+ $this->assertEquals('baz', $container->bar);
+ $container->baz = 'boo';
+ $this->assertEquals('boo', $storage['foo']['baz']);
+ }
}
@@ -111,8 +111,8 @@ public function testUnset()
public function testMultiDimensionalUnset()
{
- if (version_compare(PHP_VERSION, '5.3.3') <= 0) {
- $this->markTestSkipped('Known issue on versions of PHP 5.3.3 or less');
+ if (version_compare(PHP_VERSION, '5.3.4') < 0) {
+ $this->markTestSkipped('Known issue on versions of PHP less than 5.3.4');
}
$this->storage['foo'] = array('bar' => array('baz' => 'boo'));
unset($this->storage['foo']['bar']['baz']);
@@ -98,8 +98,8 @@ public function testMarkingOneSessionObjectImmutableShouldMarkOtherInstancesImmu
public function testMultiDimensionalUnset()
{
- if (version_compare(PHP_VERSION, '5.3.3') <= 0) {
- $this->markTestSkipped('Known issue on versions of PHP 5.3.3 or less');
+ if (version_compare(PHP_VERSION, '5.3.4') < 0) {
+ $this->markTestSkipped('Known issue on versions of PHP less than 5.3.4');
}
$this->storage['foo'] = array('bar' => array('baz' => 'boo'));
unset($this->storage['foo']['bar']['baz']);
@@ -246,8 +246,8 @@ public function testToArrayWithMetaData()
public function testUnsetMultidimensional()
{
- if (version_compare(PHP_VERSION, '5.3.3') <= 0) {
- $this->markTestSkipped('Known issue on versions of PHP 5.3.3 or less');
+ if (version_compare(PHP_VERSION, '5.3.4') < 0) {
+ $this->markTestSkipped('Known issue on versions of PHP less than 5.3.4');
}
$this->storage['foo'] = array('bar' => array('baz' => 'boo'));
unset($this->storage['foo']['bar']['baz']);
@@ -53,7 +53,7 @@ public function testStdPropList()
public function testStdPropListCannotAccessObjectVars()
{
- if (version_compare(PHP_VERSION, '5.3.3') <= 0) {
+ if (version_compare(PHP_VERSION, '5.3.4') < 0) {
$this->markTestSkipped('Behavior is for overwritten ArrayObject in greater than 5.3.3');
}
$this->setExpectedException('InvalidArgumentException');
@@ -162,7 +162,7 @@ public function testIteratorClass()
public function testInvalidIteratorClassThrowsInvalidArgumentException()
{
- if (version_compare(PHP_VERSION, '5.3.3') <= 0) {
+ if (version_compare(PHP_VERSION, '5.3.4') < 0) {
$this->markTestSkipped('Behavior is for overwritten ArrayObject in greater than 5.3.3');
}
$this->setExpectedException('InvalidArgumentException');
@@ -210,7 +210,7 @@ public function testOffsetExists()
public function testOffsetExistsThrowsExceptionOnProtectedProperty()
{
- if (version_compare(PHP_VERSION, '5.3.3') <= 0) {
+ if (version_compare(PHP_VERSION, '5.3.4') < 0) {
$this->markTestSkipped('Behavior is for overwritten ArrayObject in greater than 5.3.3');
}
$this->setExpectedException('InvalidArgumentException');
@@ -232,7 +232,7 @@ public function testOffsetGetOffsetSet()
public function testOffsetGetThrowsExceptionOnProtectedProperty()
{
- if (version_compare(PHP_VERSION, '5.3.3') <= 0) {
+ if (version_compare(PHP_VERSION, '5.3.4') < 0) {
$this->markTestSkipped('Behavior is for overwritten ArrayObject in greater than 5.3.3');
}
$this->setExpectedException('InvalidArgumentException');
@@ -242,7 +242,7 @@ public function testOffsetGetThrowsExceptionOnProtectedProperty()
public function testOffsetSetThrowsExceptionOnProtectedProperty()
{
- if (version_compare(PHP_VERSION, '5.3.3') <= 0) {
+ if (version_compare(PHP_VERSION, '5.3.4') < 0) {
$this->markTestSkipped('Behavior is for overwritten ArrayObject in greater than 5.3.3');
}
$this->setExpectedException('InvalidArgumentException');
@@ -264,7 +264,7 @@ public function testOffsetUnset()
public function testOffsetUnsetMultidimensional()
{
- if (version_compare(PHP_VERSION, '5.3.3') <= 0) {
+ if (version_compare(PHP_VERSION, '5.3.4') < 0) {
$this->markTestSkipped('Behavior is for overwritten ArrayObject in greater than 5.3.3');
}
$ar = new ArrayObject();
@@ -274,7 +274,7 @@ public function testOffsetUnsetMultidimensional()
public function testOffsetUnsetThrowsExceptionOnProtectedProperty()
{
- if (version_compare(PHP_VERSION, '5.3.3') <= 0) {
+ if (version_compare(PHP_VERSION, '5.3.4') < 0) {
$this->markTestSkipped('Behavior is for overwritten ArrayObject in greater than 5.3.3');
}
$this->setExpectedException('InvalidArgumentException');

0 comments on commit 8682fba

Please sign in to comment.