mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Add basket converter
This commit is contained in:
64
tests/Alchemy/Tests/Phrasea/ACL/BasketACLTest.php
Normal file
64
tests/Alchemy/Tests/Phrasea/ACL/BasketACLTest.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace Alchemy\Tests\Phrasea\ACL;
|
||||
|
||||
use Alchemy\Phrasea\ACL\BasketACL;
|
||||
|
||||
class BasketACLTest extends \PhraseanetPHPUnitAbstract
|
||||
{
|
||||
public function testOwnerIsOwner()
|
||||
{
|
||||
$basket = $this->insertOneBasketEnv();
|
||||
|
||||
$acl = new BasketACL();
|
||||
$this->assertTrue($acl->isOwner($basket, self::$DI['user']));
|
||||
}
|
||||
|
||||
public function testParticipantIsNotAnOwner()
|
||||
{
|
||||
$basket = $this->insertOneBasketEnv();
|
||||
|
||||
$acl = new BasketACL();
|
||||
$this->assertFalse($acl->isOwner($basket, self::$DI['user_alt1']));
|
||||
}
|
||||
|
||||
public function testUserIsNotTheOwner()
|
||||
{
|
||||
$basket = $this->insertOneBasket();
|
||||
|
||||
$acl = new BasketACL();
|
||||
$this->assertFalse($acl->isOwner($basket, self::$DI['user_alt1']));
|
||||
}
|
||||
|
||||
public function testOwnerHasAccessInValidationEnv()
|
||||
{
|
||||
$basket = $this->insertOneBasketEnv();
|
||||
|
||||
$acl = new BasketACL();
|
||||
$this->assertTrue($acl->hasAccess($basket, self::$DI['user']));
|
||||
}
|
||||
|
||||
public function testOwnerHasAccess()
|
||||
{
|
||||
$basket = $this->insertOneBasket();
|
||||
|
||||
$acl = new BasketACL();
|
||||
$this->assertTrue($acl->hasAccess($basket, self::$DI['user']));
|
||||
}
|
||||
|
||||
public function testParticipantHasAccess()
|
||||
{
|
||||
$basket = $this->insertOneBasketEnv();
|
||||
|
||||
$acl = new BasketACL();
|
||||
$this->assertTrue($acl->hasAccess($basket, self::$DI['user_alt1']));
|
||||
}
|
||||
|
||||
public function testUserHasNotAccess()
|
||||
{
|
||||
$basket = $this->insertOneBasket();
|
||||
|
||||
$acl = new BasketACL();
|
||||
$this->assertFalse($acl->hasAccess($basket, self::$DI['user_alt1']));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user