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