Pantheon\Terminus\UnitTests\Collections\OrganizationSiteMembershipsTest::testCreate PHP Method

testCreate() public method

public testCreate ( )
    public function testCreate()
    {
        $workflows = $this->getMockBuilder(Workflows::class)->disableOriginalConstructor()->getMock();
        $organization = $this->getMockBuilder(Organization::class)->disableOriginalConstructor()->getMock();
        $organization->expects($this->once())->method('getWorkflows')->willReturn($workflows);
        $site = (object) ['id' => '123'];
        $workflows->expects($this->once())->method('create')->with('add_organization_site_membership', ['params' => ['site_id' => '123', 'role' => 'team_member']]);
        $org_site_membership = new OrganizationSiteMemberships(['organization' => $organization]);
        $org_site_membership->create($site);
    }
OrganizationSiteMembershipsTest