public function testOwnerSetValidOwner()
{
$site_name = 'site_name';
$email = 'a-valid-email';
$full_name = 'Dev User';
$workflow = $this->getMockBuilder(Workflow::class)->disableOriginalConstructor()->getMock();
$user_membership = $this->getMockBuilder(SiteUserMembership::class)->disableOriginalConstructor()->getMock();
$user = $this->getMockBuilder(User::class)->disableOriginalConstructor()->getMock();
$user->id = 'user_id';
$user_membership->method('getUser')->willReturn($user);
$this->user_memberships->expects($this->once())->method('get')->with($this->equalTo($email))->willReturn($user_membership);
$this->site->expects($this->once())->method('setOwner')->with($this->equalTo($user->id))->willReturn($workflow);
$workflow->expects($this->once())->method('wait')->with()->willReturn(true);
$this->site->expects($this->once())->method('getName')->willReturn($site_name);
$user->expects($this->once())->method('getName')->willReturn($full_name);
$this->logger->expects($this->once())->method('log')->with($this->equalTo('notice'), $this->equalTo('Promoted {user} to owner of {site}'), $this->equalTo(['user' => $full_name, 'site' => $site_name]));
$out = $this->command->setOwner($site_name, $email);
$this->assertNull($out);
}