This repository has been archived by the owner on Jan 31, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
98 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?php | ||
/** | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* @link http://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
|
||
namespace ZendTest\Session; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Zend\Session\Container; | ||
use Zend\Session\Config\StandardConfig; | ||
use Zend\Session\ManagerInterface as Manager; | ||
use ZendTest\Session\TestAsset\TestContainer; | ||
|
||
/** | ||
* @group Zend_Session | ||
* @covers Zend\Session\AbstractContainer | ||
*/ | ||
class AbstractContainerTest extends TestCase | ||
{ | ||
/** | ||
* Hack to allow running tests in separate processes | ||
* | ||
* @see http://matthewturland.com/2010/08/19/process-isolation-in-phpunit/ | ||
*/ | ||
protected $preserveGlobalState = false; | ||
|
||
/** | ||
* @var Manager | ||
*/ | ||
protected $manager; | ||
|
||
/** | ||
* @var Container | ||
*/ | ||
protected $container; | ||
|
||
public function setUp() | ||
{ | ||
$_SESSION = []; | ||
Container::setDefaultManager(null); | ||
|
||
$config = new StandardConfig([ | ||
'storage' => 'Zend\\Session\\Storage\\ArrayStorage', | ||
]); | ||
|
||
$this->manager = $manager = new TestAsset\TestManager($config); | ||
$this->container = new TestContainer('Default', $manager); | ||
} | ||
|
||
public function tearDown() | ||
{ | ||
$_SESSION = []; | ||
Container::setDefaultManager(null); | ||
} | ||
|
||
/** | ||
* This test case fails on zend-session 2.8.0 with the php error below and works fine on 2.7.*. | ||
* "Only variable references should be returned by reference" | ||
*/ | ||
public function testOffsetGetMissingKey() | ||
{ | ||
self::assertNull($this->container->offsetGet('this key does not exist in the container')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
/** | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* @link http://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
|
||
namespace ZendTest\Session\TestAsset; | ||
|
||
use Zend\Session\AbstractContainer; | ||
|
||
class TestContainer extends AbstractContainer | ||
{ | ||
// do nothing | ||
} |