示例#1
0
 public function testCreateWithAssociationsGuessingFromColumn()
 {
     Phactory::define('role', array('name' => 'admin'));
     Phactory::define('user', array('name' => 'testuser'), array('role' => Phactory::manyToOne('role')));
     $role = Phactory::create('role');
     $user = Phactory::createWithAssociations('user', array('role' => $role));
     $this->assertNotNull($role->id);
     $this->assertEquals($role->id, $user->role_id);
 }