-
Notifications
You must be signed in to change notification settings - Fork 178
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
3 changed files
with
94 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the symfony package. | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
require_once __DIR__.'/../PhpUnitSfTestHelperTrait.php'; | ||
require_once __DIR__.'/../sfEventDispatcherTestCase.php'; | ||
|
||
/** | ||
* @internal | ||
* | ||
* @coversNothing | ||
*/ | ||
class sfUserEventDispatcherTest extends sfEventDispatcherTestCase | ||
{ | ||
protected $sessionPath; | ||
protected $storage; | ||
|
||
public function setUp(): void | ||
{ | ||
$this->dispatcher = new sfEventDispatcher(); | ||
$this->sessionPath = sys_get_temp_dir().'/sessions_'.rand(11111, 99999); | ||
$this->storage = new sfSessionTestStorage(array('session_path' => $this->sessionPath)); | ||
|
||
$user = new sfUser($this->dispatcher, $this->storage); | ||
|
||
$this->testObject = $user; | ||
$this->class = 'user'; | ||
} | ||
|
||
protected function tearDown(): void | ||
{ | ||
$this->storage->clear(); | ||
|
||
sfToolkit::clearDirectory($this->sessionPath); | ||
} | ||
} |
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,45 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the symfony package. | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
require_once __DIR__.'/../PhpUnitSfTestHelperTrait.php'; | ||
require_once __DIR__.'/../sfParameterHolderProxyTestCase.php'; | ||
|
||
/** | ||
* @internal | ||
* | ||
* @coversNothing | ||
*/ | ||
class sfUserParameterHolderProxyTest extends sfParameterHolderProxyTestCase | ||
{ | ||
protected $dispatcher; | ||
protected $sessionPath; | ||
protected $storage; | ||
|
||
public function setUp(): void | ||
{ | ||
$this->dispatcher = new sfEventDispatcher(); | ||
$this->sessionPath = sys_get_temp_dir().'/sessions_'.rand(11111, 99999); | ||
$this->storage = new sfSessionTestStorage(array('session_path' => $this->sessionPath)); | ||
|
||
$user = new sfUser($this->dispatcher, $this->storage); | ||
|
||
$this->methodName = 'attribute'; | ||
$this->object = $user; | ||
} | ||
|
||
protected function tearDown(): void | ||
{ | ||
$this->storage->clear(); | ||
|
||
sfToolkit::clearDirectory($this->sessionPath); | ||
} | ||
} |
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