|
@@ 834-856 (lines=23) @@
|
| 831 |
|
* |
| 832 |
|
* @covers \eZ\Publish\API\Repository\RoleService::newRoleCreateStruct |
| 833 |
|
*/ |
| 834 |
|
public function testNewRoleCreateStruct() |
| 835 |
|
{ |
| 836 |
|
$roleService = $this->repository->getRoleService(); |
| 837 |
|
|
| 838 |
|
$roleCreateStruct = $roleService->newRoleCreateStruct('Ultimate permissions'); |
| 839 |
|
|
| 840 |
|
self::assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\User\\RoleCreateStruct', $roleCreateStruct); |
| 841 |
|
|
| 842 |
|
$this->assertPropertiesCorrect( |
| 843 |
|
[ |
| 844 |
|
'identifier' => 'Ultimate permissions', |
| 845 |
|
// @todo uncomment when support for multilingual names and descriptions is added EZP-24776 |
| 846 |
|
// 'mainLanguageCode' => null, |
| 847 |
|
// 'names' => null, |
| 848 |
|
// 'descriptions' => null |
| 849 |
|
], |
| 850 |
|
$roleCreateStruct |
| 851 |
|
); |
| 852 |
|
|
| 853 |
|
self::assertEquals('Ultimate permissions', $roleCreateStruct->identifier); |
| 854 |
|
self::assertInternalType('array', $roleCreateStruct->getPolicies()); |
| 855 |
|
self::assertEmpty($roleCreateStruct->getPolicies()); |
| 856 |
|
} |
| 857 |
|
|
| 858 |
|
/** |
| 859 |
|
* Test creating new PolicyCreateStruct. |
|
@@ 863-881 (lines=19) @@
|
| 860 |
|
* |
| 861 |
|
* @covers \eZ\Publish\API\Repository\RoleService::newPolicyCreateStruct |
| 862 |
|
*/ |
| 863 |
|
public function testNewPolicyCreateStruct() |
| 864 |
|
{ |
| 865 |
|
$roleService = $this->repository->getRoleService(); |
| 866 |
|
|
| 867 |
|
$policyCreateStruct = $roleService->newPolicyCreateStruct('content', 'read'); |
| 868 |
|
|
| 869 |
|
self::assertInstanceOf('\\eZ\\Publish\\API\\Repository\\Values\\User\\PolicyCreateStruct', $policyCreateStruct); |
| 870 |
|
|
| 871 |
|
$this->assertPropertiesCorrect( |
| 872 |
|
[ |
| 873 |
|
'module' => 'content', |
| 874 |
|
'function' => 'read', |
| 875 |
|
], |
| 876 |
|
$policyCreateStruct |
| 877 |
|
); |
| 878 |
|
|
| 879 |
|
self::assertInternalType('array', $policyCreateStruct->getLimitations()); |
| 880 |
|
self::assertEmpty($policyCreateStruct->getLimitations()); |
| 881 |
|
} |
| 882 |
|
|
| 883 |
|
/** |
| 884 |
|
* Test creating new RoleUpdateStruct. |