$summit_id ]; $name = str_random(16).'_question'; $data = [ 'name' => $name, 'type' => SummitOrderExtraQuestionTypeConstants::ComboBoxQuestionType, 'label' => $name, 'usage' => SummitOrderExtraQuestionTypeConstants::BothQuestionUsage, 'mandatory' => true, 'printable' => true, 'placeholder' => $name, ]; $headers = [ "HTTP_Authorization" => " Bearer " . $this->access_token, "CONTENT_TYPE" => "application/json" ]; $response = $this->action( "POST", "OAuth2SummitOrderExtraQuestionTypeApiController@add", $params, [], [], [], $headers, json_encode($data) ); $content = $response->getContent(); $this->assertResponseStatus(201); $question = json_decode($content); $this->assertTrue(!is_null($question)); return $question; } public function testAddQuestionValue($summit_id=27){ $question = $this->testAddExtraOrderQuestion($summit_id); $params = [ 'id' => $summit_id, 'question_id' => $question->id ]; $name = str_random(16).'_question'; $data = [ 'value' => $name, 'label' => $name, ]; $headers = [ "HTTP_Authorization" => " Bearer " . $this->access_token, "CONTENT_TYPE" => "application/json" ]; $response = $this->action( "POST", "OAuth2SummitOrderExtraQuestionTypeApiController@addQuestionValue", $params, [], [], [], $headers, json_encode($data) ); $content = $response->getContent(); $this->assertResponseStatus(201); $question = json_decode($content); $this->assertTrue(!is_null($question)); return $question; } }