Esempio n. 1
0
 function testMakeItemAndCollection()
 {
     $m = $this->getManager('test_');
     $s = new Schema($m);
     $s->setName('Users');
     $s->setTable('users');
     $s->addId()->addBool('is_active')->addEnum('type', array('new', 'old'))->addBitmask('level', array('guest', 'owner', 'admin'))->addInt('age')->addChar('name')->addFloat('price')->addDate('birthday')->addTime('created_at')->addFile('pdf')->addImage('avatar')->addImage('photo', array('thumb', 'big'));
     //    file_put_contents($this->temp . '/UsersRepository.php', $s->makeRepository());
     $exp = file_get_contents($this->temp . '/UsersRepository.php');
     $this->assertEquals($exp, $s->makeRepository(), 'Репозиторий');
     //    file_put_contents($this->temp . '/UserItem.php', $s->makeItem());
     $exp = file_get_contents($this->temp . '/UserItem.php');
     $this->assertEquals($exp, $s->makeItem(), 'Item');
 }