-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #864 from guillaumelecerf/dont_save_invalid_usercache
Fix EZP-22181: eZUser: do not generate cache content for invalid user
- Loading branch information
Showing
3 changed files
with
130 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
/** | ||
* File containing the eZUserCacheTest class. | ||
* | ||
* @copyright Copyright (C) 1999-2013 eZ Systems AS. All rights reserved. | ||
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2 | ||
* @version //autogentag// | ||
* @package tests | ||
*/ | ||
|
||
class eZUserCacheTest extends ezpDatabaseTestCase | ||
{ | ||
private $userId; | ||
|
||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
$this->setName( "eZUser Cache Unit Tests" ); | ||
} | ||
|
||
public function setUp() | ||
{ | ||
$this->userId = 12345; | ||
parent::setUp(); | ||
} | ||
|
||
public function tearDown() | ||
{ | ||
eZUser::purgeUserCacheByUserId( $this->userId ); | ||
eZDir::cleanupEmptyDirectories( eZUser::getCacheDir( $this->userId ) ); | ||
parent::tearDown(); | ||
} | ||
|
||
/** | ||
* eZUser: do not generate cache content for invalid user | ||
* | ||
* @link http://issues.ez.no/22181 | ||
*/ | ||
public function testNullUserCache() | ||
{ | ||
eZUser::instance( $this->userId ); | ||
|
||
$cacheFilePath = eZUser::getCacheDir( $this->userId ) . "/user-data-{$this->userId}.cache.php"; | ||
$this->assertFalse( file_exists( $cacheFilePath ) ); | ||
} | ||
} | ||
?> |
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