Permalink
Browse files

Merge branch 'hotfix/3713' into develop

Forward port #3713
  • Loading branch information...
2 parents 9b92d74 + b05bc6e commit c5cc2d279c592d852f57568d36fa3a8633509827 @weierophinney weierophinney 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';
}
@@ -71,6 +71,7 @@ protected function forceAutoloader()
public function run(\PHPUnit_Framework_TestResult $result = NULL)
{
$this->setPreserveGlobalState(false);
+
return parent::run($result);
}
@@ -529,11 +530,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 c5cc2d2

Please sign in to comment.