Пример #1
0
 public function testAuthenticationMethodDefaultsToLocal()
 {
     $person = new Person();
     $person->setFirstname('First');
     $person->setLastname('Last');
     $person->setEmail('test@localhost');
     $person->setUsername('test');
     $person->validate();
     $this->assertEquals('local', $person->getAuthenticationMethod());
 }
Пример #2
0
 public function testSave()
 {
     $person = new Person();
     $person->setFirstname('First');
     $person->setLastname('Last');
     $person->setEmail('test@localhost');
     $person->save();
     $person = new Person('test@localhost');
     $this->assertEquals('First', $person->getFirstname());
     $this->assertEquals('Last', $person->getLastname());
     $this->assertEquals('test@localhost', $person->getEmail());
 }
<?php

/**
 * @copyright 2012-2013 City of Bloomington, Indiana
 * @license http://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE.txt
 * @author Cliff Ingham <*****@*****.**>
 */
use Application\Models\Person;
include '../configuration.inc';
$person = new Person();
$person->setFirstname('Administrator');
$person->setLastname('Person');
$person->setEmail('*****@*****.**');
$person->setUsername('admin');
//$person->setPassword();
$person->setAuthenticationMethod('Employee');
$person->setRole('Administrator');
$person->save();