|
|
@@ -268,6 +268,21 @@ trait IntegrationTestTrait
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Sets HTTP headers for the *next* request to be identified as JSON request.
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function setJsonHeader(): void
|
|
|
+ {
|
|
|
+ $this->configRequest([
|
|
|
+ 'headers' => [
|
|
|
+ 'Accept' => 'application/json',
|
|
|
+ 'Content-Type' => 'application/json',
|
|
|
+ ],
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* Configures the data for the *next* request.
|
|
|
*
|
|
|
* This data is cleared in the tearDown() method.
|
|
|
@@ -281,7 +296,7 @@ trait IntegrationTestTrait
|
|
|
*/
|
|
|
public function configRequest(array $data): void
|
|
|
{
|
|
|
- $this->_request = $data + $this->_request;
|
|
|
+ $this->_request = array_merge_recursive($data, $this->_request);
|
|
|
}
|
|
|
|
|
|
/**
|