Adds a site to this organization
public create ( Site $site ) : Workflow | ||
$site | Site | Site object of site to add to this organization |
Результат | Workflow |
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); }