str_random(16).'summit_media_file_type', 'allowed_extensions' => ['PDF', 'SVG'] ]; $headers = [ "HTTP_Authorization" => " Bearer " . $this->access_token, "CONTENT_TYPE" => "application/json" ]; $response = $this->action( "POST", "OAuth2SummitMediaFileTypeApiController@add", [], [], [], [], $headers, json_encode($payload) ); $content = $response->getContent(); $response = json_decode($content, true); $this->assertResponseStatus(201); $this->assertTrue(isset($response['id'])); } public function testGetAll(){ $headers = [ "HTTP_Authorization" => " Bearer " . $this->access_token, "CONTENT_TYPE" => "application/json" ]; $response = $this->action( "GET", "OAuth2SummitMediaFileTypeApiController@getAll", [], [], [], [], $headers ); $content = $response->getContent(); $this->assertResponseStatus(200); $response = json_decode($content, true); $this->assertTrue(isset($response['total'])); $this->assertTrue(intval($response['total']) > 0); } }