Example #1
0
 function Test_of_getAvailableAttributes()
 {
     $User = new AkTestUser();
     $User->addCombinedAttributeConfiguration('name', "%s %s", 'first_name', 'last_name');
     $tmp_got = $User->getAvailableAttributes();
     $expected = array('name' => 'name', 'type' => 'string', 'path' => '%s %s', 'uses' => array('first_name', 'last_name'));
     $got = $tmp_got['name'];
     $this->assertEqual($got, $expected);
     $expected = array('name' => 'id', 'type' => 'serial', 'primaryKey' => 1);
     $got = array('name' => $tmp_got['id']['name'], 'type' => $tmp_got['id']['type'], 'primaryKey' => $tmp_got['id']['primaryKey']);
     $this->assertEqual($got, $expected);
     $expected = array('name' => 'created_at', 'type' => 'datetime');
     $got = array('name' => $tmp_got['created_at']['name'], 'type' => $tmp_got['created_at']['type']);
     $this->assertEqual($got, $expected);
 }