Skip to content

Commit

Permalink
Revert "Fixed failures in integration tests caused by d04bb24"
Browse files Browse the repository at this point in the history
This reverts commit 2549f18.
  • Loading branch information
andrerom committed Apr 16, 2012
1 parent 2549f18 commit dde6b99
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 36 deletions.
5 changes: 5 additions & 0 deletions eZ/Publish/API/Repository/Tests/Stubs/UserServiceStub.php
Expand Up @@ -106,6 +106,7 @@ public function createUserGroup( UserGroupCreateStruct $userGroupCreateStruct, U

$userGroup = new UserGroupStub(
array(
'id' => $content->id,
'parentId' => $parentGroup->id,
'subGroupCount' => 0,
'content' => $content
Expand All @@ -114,6 +115,7 @@ public function createUserGroup( UserGroupCreateStruct $userGroupCreateStruct, U
$this->userGroups[$userGroup->id] = $userGroup;
$this->userGroups[$parentGroup->id] = new UserGroupStub(
array(
'id' => $parentGroup->id,
'parentId' => $parentGroup->parentId,
'subGroupCount' => $parentGroup->subGroupCount + 1,
'content' => $parentGroup->content
Expand Down Expand Up @@ -294,6 +296,7 @@ public function updateUserGroup( UserGroup $userGroup, UserGroupUpdateStruct $us
{
$this->userGroups[$userGroup->id] = new UserGroupStub(
array(
'id' => $userGroup->id,
'parentId' => $userGroup->parentId,
'subGroupCount' => $userGroup->subGroupCount,
'content' => $content
Expand Down Expand Up @@ -351,6 +354,7 @@ public function createUser( UserCreateStruct $userCreateStruct, array $parentGro

$user = new UserStub(
array(
'id' => $content->id,
'login' => $userCreateStruct->login,
'email' => $userCreateStruct->email,
'passwordHash' => $this->createHash(
Expand Down Expand Up @@ -504,6 +508,7 @@ public function updateUser( User $user, UserUpdateStruct $userUpdateStruct )

$this->users[$user->id] = new UserStub(
array(
'id' => $user->id,
'login' => $user->login,
'email' => $userUpdateStruct->email ?: $user->email,
'isEnabled' => is_null( $userUpdateStruct->isEnabled ) ? $user->isEnabled : $userUpdateStruct->isEnabled,
Expand Down
2 changes: 2 additions & 0 deletions eZ/Publish/API/Repository/Tests/_fixtures/UserFixture.php
Expand Up @@ -3,6 +3,7 @@
array(
10 => new \eZ\Publish\API\Repository\Tests\Stubs\Values\User\UserStub(
array(
"id" => 10,
"login" => "anonymous",
"email" => "nospam@ez.no",
"passwordHash" => "4e6f6184135228ccd45f8233d72a0363",
Expand All @@ -13,6 +14,7 @@
),
14 => new \eZ\Publish\API\Repository\Tests\Stubs\Values\User\UserStub(
array(
"id" => 14,
"login" => "admin",
"email" => "kn@ez.no",
"passwordHash" => "c78e3b0f3d9244ed8c6d1c29464bdff9",
Expand Down
Expand Up @@ -3,41 +3,47 @@
array(
4 => new \eZ\Publish\API\Repository\Tests\Stubs\Values\User\UserGroupStub(
array(
"id" => 4,
"parentId" => 0,
"subGroupCount" => 5,
"content" => $this->getContentService()->loadContent( 4 ),
)
),
11 => new \eZ\Publish\API\Repository\Tests\Stubs\Values\User\UserGroupStub(
array(
"id" => 11,
"parentId" => 4,
"subGroupCount" => 0,
"content" => $this->getContentService()->loadContent( 11 ),
)
),
12 => new \eZ\Publish\API\Repository\Tests\Stubs\Values\User\UserGroupStub(
array(
"id" => 12,
"parentId" => 4,
"subGroupCount" => 0,
"content" => $this->getContentService()->loadContent( 12 ),
)
),
13 => new \eZ\Publish\API\Repository\Tests\Stubs\Values\User\UserGroupStub(
array(
"id" => 13,
"parentId" => 4,
"subGroupCount" => 0,
"content" => $this->getContentService()->loadContent( 13 ),
)
),
42 => new \eZ\Publish\API\Repository\Tests\Stubs\Values\User\UserGroupStub(
array(
"id" => 42,
"parentId" => 4,
"subGroupCount" => 0,
"content" => $this->getContentService()->loadContent( 42 ),
)
),
225 => new \eZ\Publish\API\Repository\Tests\Stubs\Values\User\UserGroupStub(
array(
"id" => 225,
"parentId" => 4,
"subGroupCount" => 0,
"content" => $this->getContentService()->loadContent( 225 ),
Expand Down
3 changes: 2 additions & 1 deletion eZ/Publish/API/Repository/Tests/common.php
Expand Up @@ -19,9 +19,10 @@
$repository->setCurrentUser(
new \eZ\Publish\API\Repository\Tests\Stubs\Values\User\UserStub(
array(
'id' => 14,
'content' => new \eZ\Publish\API\Repository\Tests\Stubs\Values\Content\ContentStub(
array(
'id' => 14
'contentId' => 14
)
)
)
Expand Down
35 changes: 1 addition & 34 deletions eZ/Publish/Core/Persistence/Legacy/EzcDbHandler.php
Expand Up @@ -9,10 +9,7 @@

namespace eZ\Publish\Core\Persistence\Legacy;
use ezcDbHandler as ezcDbHandlerWrapped,
ezcQuerySelect,
eZ\Publish\Core\Persistence\Legacy\EzcDbHandler\Pgsql,
eZ\Publish\Core\Persistence\Legacy\EzcDbHandler\Sqlite,
ezcDbFactory;
ezcQuerySelect;

/**
* Wrapper class for the zeta components database handler, providing some
Expand Down Expand Up @@ -40,36 +37,6 @@ public function __construct( ezcDbHandlerWrapped $ezcDbHandler )
$this->ezcDbHandler = $ezcDbHandler;
}

/**
* Factory for getting EzcDbHandler handler object
*
* Will use postgres or sqllite specific wrappers if dsn indicates such databases.
*
* @static
* @param $dsn
* @return EzcDbHandler
*/
public static function create( $dsn )
{
$connection = ezcDbFactory::create( $dsn );
$database = preg_replace( '(^([a-z]+).*)', '\\1', $dsn );

switch ( $database )
{
case 'pgsql':
$dbHandler = new Pgsql( $connection );
break;

case 'sqlite':
$dbHandler = new Sqlite( $connection );
break;

default:
$dbHandler = new EzcDbHandler( $connection );
}
return $dbHandler;
}

/**
* Proxy methods to the aggregated DB handler
*
Expand Down
5 changes: 4 additions & 1 deletion eZ/Publish/Core/Persistence/Legacy/Handler.php
Expand Up @@ -28,8 +28,11 @@
eZ\Publish\Core\Persistence\Legacy\Content\Search\Utf8Converter,
eZ\Publish\Core\Persistence\Legacy\Content\Search\Gateway\CriterionHandler,
eZ\Publish\Core\Persistence\Legacy\Content\Search\Gateway\SortClauseHandler,
eZ\Publish\Core\Persistence\Legacy\EzcDbHandler\Pgsql,
eZ\Publish\Core\Persistence\Legacy\EzcDbHandler\Sqlite,
eZ\Publish\Core\Persistence\Legacy\User,
eZ\Publish\Core\Persistence\Legacy\User\Mapper as UserMapper;
eZ\Publish\Core\Persistence\Legacy\User\Mapper as UserMapper,
ezcDbFactory;

/**
* The repository handler for the legacy storage engine
Expand Down

0 comments on commit dde6b99

Please sign in to comment.