Beispiel #1
0
 /**
  * Test username getter / setter.
  */
 public function testUsername()
 {
     $protection = new Protection();
     $username = '******';
     $protection->setUsername($username);
     $this->assertEquals($username, $protection->getUsername());
 }
 /**
  * Transform to protection model.
  *
  * @param Entity $protection
  *
  * @return Config[]
  */
 public static function transform(Entity $protection)
 {
     $return = array();
     $path = sprintf(self::path, $protection->getDomain()->getPath(), $protection->getId());
     foreach ($protection->getProtectionuser() as $user) {
         /** @var EntityUser $user */
         $model = new Config();
         $model->setUsername($user->getUsername())->setPassword($user->getPassword())->setPath($path)->setId($user->getProtection()->getId());
         $return[] = $model;
     }
     return $return;
 }