names() public method

public names ( )
示例#1
0
 public function testShortHandTypeDefinitions()
 {
     $schema = new Schema(array('fields' => array('id' => 'int', 'name' => 'string', 'active' => array('type' => 'boolean', 'default' => true))));
     $this->assertEqual('int', $schema->type('id'));
     $this->assertEqual('string', $schema->type('name'));
     $this->assertEqual('boolean', $schema->type('active'));
     $this->assertEqual(array('type' => 'int'), $schema->fields('id'));
     $this->assertEqual(array('id', 'name', 'active'), $schema->names());
     $expected = array('id' => array('type' => 'int'), 'name' => array('type' => 'string'), 'active' => array('type' => 'boolean', 'default' => true));
     $this->assertEqual($expected, $schema->fields());
 }