Пример #1
0
 /**
  * Test prePersist role that to generate new value of "role" field
  */
 public function testPrePersistValid()
 {
     $role = new Role();
     $this->assertEmpty($role->getId());
     $this->assertEmpty($role->getRole());
     $this->listener->prePersist($this->getPrePersistEvent($role));
     $this->assertNotEmpty($role->getRole());
 }
Пример #2
0
 public function testRole()
 {
     $role = new Role();
     $this->assertEmpty($role->getId());
     $this->assertEmpty($role->getRole());
     $role->setRole('foo');
     $this->assertStringStartsWith('ROLE_FOO', $role->getRole());
     $this->assertEquals(Role::PREFIX_ROLE, $role->getPrefix());
 }
 /**
  * @param Role $role
  *
  * @Given /^I should be on the ("([^"]*)" role) page$/
  */
 public function iShouldBeOnTheRolePage(Role $role)
 {
     $expectedAddress = $this->getPage('Role edit')->getUrl(['id' => $role->getId()]);
     $this->assertAddress($expectedAddress);
 }
 /**
  * {@inheritDoc}
  */
 public function getId()
 {
     if ($this->__isInitialized__ === false) {
         return (int) parent::getId();
     }
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getId', array());
     return parent::getId();
 }