Beispiel #1
0
 public function testCreateWithAssociations()
 {
     Phactory::define('role', array('name' => 'admin'));
     Phactory::define('user', array('name' => 'testuser'), array('role' => Phactory::embedsOne('role')));
     $role = Phactory::build('role');
     $user = Phactory::createWithAssociations('user', array('role' => $role));
     $this->assertEquals($role['name'], $user['role']['name']);
 }