forked from ezsystems/ezpublish-kernel
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
7 changed files
with
192 additions
and
0 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
28 changes: 28 additions & 0 deletions
28
eZ/Publish/Core/MVC/Symfony/Cache/Http/SignalSlot/CreateUserGroupSlot.php
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,28 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) eZ Systems AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
namespace eZ\Publish\Core\MVC\Symfony\Cache\Http\SignalSlot; | ||
|
||
use eZ\Publish\Core\SignalSlot\Signal; | ||
|
||
/** | ||
* A slot handling CreateUserGroupSignal. | ||
*/ | ||
class CreateUserGroupSlot extends PurgeForContentHttpCacheSlot | ||
{ | ||
/** | ||
* @param \eZ\Publish\Core\SignalSlot\Signal\UserService\CreateUserGroupSignal $signal | ||
*/ | ||
protected function extractContentId(Signal $signal) | ||
{ | ||
return $signal->userGroupId; | ||
} | ||
|
||
protected function supports(Signal $signal) | ||
{ | ||
return $signal instanceof Signal\UserService\CreateUserGroupSignal; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
eZ/Publish/Core/MVC/Symfony/Cache/Http/SignalSlot/CreateUserSlot.php
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,28 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) eZ Systems AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
namespace eZ\Publish\Core\MVC\Symfony\Cache\Http\SignalSlot; | ||
|
||
use eZ\Publish\Core\SignalSlot\Signal; | ||
|
||
/** | ||
* A slot handling CreateUserSignal. | ||
*/ | ||
class CreateUserSlot extends PurgeForContentHttpCacheSlot | ||
{ | ||
/** | ||
* @param \eZ\Publish\Core\SignalSlot\Signal\UserService\CreateUserSignal $signal | ||
*/ | ||
protected function extractContentId(Signal $signal) | ||
{ | ||
return $signal->userId; | ||
} | ||
|
||
protected function supports(Signal $signal) | ||
{ | ||
return $signal instanceof Signal\UserService\CreateUserSignal; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
eZ/Publish/Core/MVC/Symfony/Cache/Http/SignalSlot/UpdateUserGroupSlot.php
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,28 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) eZ Systems AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
namespace eZ\Publish\Core\MVC\Symfony\Cache\Http\SignalSlot; | ||
|
||
use eZ\Publish\Core\SignalSlot\Signal; | ||
|
||
/** | ||
* A slot handling UpdateUserGroupSignal. | ||
*/ | ||
class UpdateUserGroupSlot extends PurgeForContentHttpCacheSlot | ||
{ | ||
/** | ||
* @param \eZ\Publish\Core\SignalSlot\Signal\UserService\UpdateUserGroupSignal $signal | ||
*/ | ||
protected function extractContentId(Signal $signal) | ||
{ | ||
return $signal->userGroupId; | ||
} | ||
|
||
protected function supports(Signal $signal) | ||
{ | ||
return $signal instanceof Signal\UserService\UpdateUserGroupSignal; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
eZ/Publish/Core/MVC/Symfony/Cache/Tests/Http/SignalSlot/CreateUserGroupSlotTest.php
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,29 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) eZ Systems AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
namespace eZ\Publish\Core\MVC\Symfony\Cache\Tests\Http\SignalSlot; | ||
|
||
use eZ\Publish\Core\SignalSlot\Signal\UserService\CreateUserGroupSignal; | ||
|
||
class CreateUserGroupSlotTest extends AbstractPurgeForContentSlotTest implements SlotTest, PurgeForContentExpectation | ||
{ | ||
public static function createSignal() | ||
{ | ||
return new CreateUserGroupSignal([ | ||
'userGroupId' => self::getContentId(), | ||
]); | ||
} | ||
|
||
public function getSlotClass() | ||
{ | ||
return 'eZ\Publish\Core\MVC\Symfony\Cache\Http\SignalSlot\CreateUserGroupSlot'; | ||
} | ||
|
||
public static function getReceivedSignalClasses() | ||
{ | ||
return ['eZ\Publish\Core\SignalSlot\Signal\UserService\CreateUserGroupSignal']; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
eZ/Publish/Core/MVC/Symfony/Cache/Tests/Http/SignalSlot/CreateUserSlotTest.php
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,29 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) eZ Systems AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
namespace eZ\Publish\Core\MVC\Symfony\Cache\Tests\Http\SignalSlot; | ||
|
||
use eZ\Publish\Core\SignalSlot\Signal\UserService\CreateUserSignal; | ||
|
||
class CreateUserSlotTest extends AbstractPurgeForContentSlotTest implements SlotTest, PurgeForContentExpectation | ||
{ | ||
public static function createSignal() | ||
{ | ||
return new CreateUserSignal([ | ||
'userId' => self::getContentId(), | ||
]); | ||
} | ||
|
||
public function getSlotClass() | ||
{ | ||
return 'eZ\Publish\Core\MVC\Symfony\Cache\Http\SignalSlot\CreateUserSlot'; | ||
} | ||
|
||
public static function getReceivedSignalClasses() | ||
{ | ||
return ['eZ\Publish\Core\SignalSlot\Signal\UserService\CreateUserSignal']; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
eZ/Publish/Core/MVC/Symfony/Cache/Tests/Http/SignalSlot/UpdateUserGroupSlotTest.php
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,29 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) eZ Systems AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
namespace eZ\Publish\Core\MVC\Symfony\Cache\Tests\Http\SignalSlot; | ||
|
||
use eZ\Publish\Core\SignalSlot\Signal\UserService\UpdateUserGroupSignal; | ||
|
||
class UpdateUserGroupSlotTest extends AbstractPurgeForContentSlotTest implements SlotTest, PurgeForContentExpectation | ||
{ | ||
public static function createSignal() | ||
{ | ||
return new UpdateUserGroupSignal([ | ||
'userGroupId' => self::getContentId(), | ||
]); | ||
} | ||
|
||
public function getSlotClass() | ||
{ | ||
return 'eZ\Publish\Core\MVC\Symfony\Cache\Http\SignalSlot\UpdateUserGroupSlot'; | ||
} | ||
|
||
public static function getReceivedSignalClasses() | ||
{ | ||
return ['eZ\Publish\Core\SignalSlot\Signal\UserService\UpdateUserGroupSignal']; | ||
} | ||
} |