['name=@tip'], 'order' => '-id' ]; $headers = array("HTTP_Authorization" => " Bearer " . $this->access_token); $response = $this->action( "GET", "OAuth2OrganizationsApiController@getAll", $params, array(), array(), array(), $headers ); $content = $response->getContent(); $organizations = json_decode($content); $this->assertTrue(!is_null($organizations)); $this->assertResponseStatus(200); } public function testAddOrganization(){ $name = str_random(16).'_org_name'; $data = [ 'name' => $name, ]; $headers = [ "HTTP_Authorization" => " Bearer " . $this->access_token, "CONTENT_TYPE" => "application/json" ]; $response = $this->action( "POST", "OAuth2OrganizationsApiController@addOrganization", [], [], [], [], $headers, json_encode($data) ); $content = $response->getContent(); $this->assertResponseStatus(201); $org = json_decode($content); $this->assertTrue(!is_null($org)); return $org; } }