Pantheon\Terminus\UnitTests\Commands\Site\Team\AddCommandTest::testAddCommand PHP Method

testAddCommand() public method

Tests the site:team:add command
public testAddCommand ( )
    public function testAddCommand()
    {
        $new_member = '[email protected]';
        $message = 'message';
        $role = 'any_role';
        $this->site->expects($this->once())->method('getFeature')->with('change_management')->willReturn(true);
        $this->user_memberships->expects($this->once())->method('create')->willReturn($this->workflow)->with($new_member, $role);
        $this->workflow->expects($this->once())->method('checkProgress')->with()->willReturn(true);
        $this->workflow->expects($this->once())->method('getMessage')->with()->willReturn($message);
        $this->logger->expects($this->once())->method('log')->with($this->equalTo('notice'), $this->equalTo($message));
        $out = $this->command->add('mysite', $new_member, $role);
        $this->assertNull($out);
    }