propel-bundle/Tests/Model/AclClassTest.php

40 lines
1.1 KiB
PHP
Raw Normal View History

2013-12-14 12:44:04 +01:00
<?php
/**
* This file is part of the PropelBundle package.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license MIT License
*/
namespace Propel\PropelBundle\Tests\Model\Acl;
use Propel\PropelBundle\Model\Acl\AclClass;
use Propel\PropelBundle\Model\Acl\AclClassQuery;
use Symfony\Component\Security\Acl\Domain\ObjectIdentity;
use Propel\PropelBundle\Tests\AclTestCase;
/**
* @author Toni Uebernickel <tuebernickel@gmail.com>
*/
class AclClassTest extends AclTestCase
{
public function testFromAclObjectIdentity()
{
$type = 'Merchant';
$aclClass = AclClass::fromAclObjectIdentity(new ObjectIdentity(5, $type), $this->con);
$this->assertInstanceOf('Propel\PropelBundle\Model\Acl\AclClass', $aclClass);
$this->assertEquals($type, $aclClass->getType());
$dbEntry = AclClassQuery::create()->findOne($this->con);
$this->assertInstanceOf('Propel\PropelBundle\Model\Acl\AclClass', $dbEntry);
$this->assertEquals($type, $dbEntry->getType());
$this->assertEquals($dbEntry->getId(), $aclClass->getId());
}
}