Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/3713' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/AbstractContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
2 changes: 1 addition & 1 deletion src/compatibility/autoload.php
Original file line number Diff line number Diff line change
@@ -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';
}
16 changes: 14 additions & 2 deletions test/ContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ protected function forceAutoloader()
public function run(\PHPUnit_Framework_TestResult $result = NULL)
{
$this->setPreserveGlobalState(false);

return parent::run($result);
}

Expand Down Expand Up @@ -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']);
}
}
4 changes: 2 additions & 2 deletions test/SessionArrayStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down
4 changes: 2 additions & 2 deletions test/SessionStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down
4 changes: 2 additions & 2 deletions test/StorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down

0 comments on commit 6cd974a

Please sign in to comment.