Re-fetches workflow data hydrated with logs
public fetchWithLogs ( ) : |
||
return |
/** * */ public function testFetchWithLogs() { $data = ['id' => 'workflow_id']; $site = new Site((object) ['id' => 'site_id']); $environments = new Environments(['site' => $site]); $env = new Environment((object) ['id' => 'env_id'], ['collection' => $environments]); $user = new User((object) ['id' => 'user_id']); $org = new Organization((object) ['id' => 'org_id']); $this->workflow = new Workflow((object) $data, ['environment' => $env]); $this->request->expects($this->at(0))->method('request')->with('sites/site_id/workflows/workflow_id', ['options' => ['method' => 'get'], 'query' => ['hydrate' => 'operations_with_logs']])->willReturn(['data' => ['baz' => '123']]); $this->workflow->setRequest($this->request); $this->workflow->fetchWithLogs(); $this->workflow = new Workflow((object) $data, ['site' => $site]); $this->request->expects($this->at(0))->method('request')->with('sites/site_id/workflows/workflow_id', ['options' => ['method' => 'get'], 'query' => ['hydrate' => 'operations_with_logs']])->willReturn(['data' => ['baz' => '123']]); $this->workflow->setRequest($this->request); $this->workflow->fetchWithLogs(); $this->workflow = new Workflow((object) $data, ['user' => $user]); $this->request->expects($this->at(0))->method('request')->with('users/user_id/workflows/workflow_id', ['options' => ['method' => 'get'], 'query' => ['hydrate' => 'operations_with_logs']])->willReturn(['data' => ['baz' => '123']]); $this->workflow->setRequest($this->request); $this->workflow->fetchWithLogs(); $session = $this->getMockBuilder(Session::class)->disableOriginalConstructor()->getMock(); $session->expects($this->once())->method('getUser')->willReturn($user); $this->workflow = new Workflow((object) $data, ['organization' => $org]); $this->request->expects($this->at(0))->method('request')->with('users/user_id/organizations/org_id/workflows/workflow_id', ['options' => ['method' => 'get'], 'query' => ['hydrate' => 'operations_with_logs']])->willReturn(['data' => ['baz' => '123']]); $this->workflow->setSession($session); $this->workflow->setRequest($this->request); $this->workflow->fetchWithLogs(); }