コード例 #1
0
ファイル: UserTest.php プロジェクト: laiello/plankonindia
 /**
  * testDisplayFields
  *
  * @return void
  */
 public function testDisplayFields()
 {
     $result = $this->User->displayFields();
     $expected = array('id' => array('label' => 'Id', 'sort' => true, 'type' => 'text', 'url' => array(), 'options' => array()), 'username' => array('label' => 'Username', 'sort' => true, 'type' => 'text', 'url' => array(), 'options' => array()), 'name' => array('label' => 'Name', 'sort' => true, 'type' => 'text', 'url' => array(), 'options' => array()), 'email' => array('label' => 'Email', 'sort' => true, 'type' => 'text', 'url' => array(), 'options' => array()), 'status' => array('label' => 'Status', 'sort' => true, 'type' => 'boolean', 'url' => array(), 'options' => array()), 'Role.title' => array('label' => 'Role', 'sort' => true, 'type' => 'text', 'url' => array(), 'options' => array()));
     $this->assertEquals($expected, $result);
     $result = $this->User->displayFields(array('one', 'two', 'three'));
     $expected = array('one' => array('label' => 'One', 'sort' => true, 'type' => 'text', 'url' => array(), 'options' => array()), 'two' => array('label' => 'Two', 'sort' => true, 'type' => 'text', 'url' => array(), 'options' => array()), 'three' => array('label' => 'Three', 'sort' => true, 'type' => 'text', 'url' => array(), 'options' => array()));
     $this->assertEquals($expected, $result);
 }