Lines Matching refs:this
23 $this->tester = $tester;
48 if ( ! $this->debugOutputted) {
49 $this->debugOutput();
53 $this->tester->printLogs();
115 $this->data = $data;
116 $this->expectInvalid = $expectInvalid;
131 if ( ! $this->checkIfValid()) {
132 $this->error('Response is invalid');
133 } elseif ( ! $this->checkDefaultHeaders($contentType)) {
134 $this->error('Response default headers not found');
135 } elseif ($body !== $this->rawBody) {
137 $this->error(
139 "==> does not match the actual body:\n$this->rawBody"
142 $this->error(
143 "The expected body '$body' does not match actual body '$this->rawBody'"
148 return $this;
161 $rawData = $this->getBody('application/json');
164 return $this;
167 $this->error(
171 return $this;
185 $rawData = $this->getBody('application/json');
188 $this->error(
194 return $this;
198 $this->error(
202 return $this;
210 return $this->expectBody('');
223 $this->checkHeader($name, $value, $useRegex);
225 return $this;
234 $this->checkNoHeader($name);
236 return $this;
248 $errorData = $this->getErrorData();
253 $this->error($expectedErrorMessage);
256 return $this;
268 $errorData = $this->getErrorData();
270 $this->error(
273 $this->debugOutput();
276 return $this;
287 $headers = $this->getHeaders();
289 return $this;
292 $this->error('Status is expected but not supplied');
295 $this->error("Status is $statusMessage but the actual value is {$headers['status']}");
298 return $this;
307 return $this->expectStatus(null);
317 return $this->expectError(null);
329 if ($this->checkIfValid() && $this->checkDefaultHeaders($contentType)) {
330 return $this->rawBody;
343 var_dump($this->getBody($contentType));
353 echo $this->getBody($contentType) . "\n";
363 echo $this->data['out_response'] . "\n";
365 echo $this->data['err_response'] . "\n";
368 $this->debugOutputted = true;
376 return $this->data['err_response'];
386 if ($this->isValid()) {
390 if ( ! $this->expectInvalid) {
391 $this->error("The response is invalid: $this->rawData");
408 ( ! ini_get('expose_php') || $this->checkHeader('X-Powered-By', '|^PHP/8|', true)) &&
409 $this->checkHeader('Content-type', '|^' . $contentType . '(;\s?charset=\w+)?|', true)
425 $headers = $this->getHeaders();
427 return $this->error("The header $name is not present");
436 return $this->error("The header $name value '$header' is not the same as '$value'");
440 return $this->error("The header $name value '$header' does not match RegExp '$value'");
453 $headers = $this->getHeaders();
455 return $this->error("The header $name is present");
468 if ( ! $this->isValid()) {
472 if (is_array($this->headers)) {
473 return $this->headers;
476 $headerRows = explode("\r\n", $this->rawHeaders);
481 $this->error("Invalid header row (no colon): $headerRow");
488 return ($this->headers = $headers);
496 if ($this->valid === null) {
497 $this->processData();
500 return $this->valid;
508 $this->rawData = $this->data['out_response'];
509 $this->valid = (
510 ! is_null($this->rawData) &&
511 strpos($this->rawData, self::HEADER_SEPARATOR)
513 if ($this->valid) {
514 list ($this->rawHeaders, $this->rawBody) = array_map(
516 explode(self::HEADER_SEPARATOR, $this->rawData)
540 $this->error('Invalid values supplied', true);
542 $this->values = [];
544 $this->values = $values;
558 if ( ! isset($this->values[$name])) {
559 $this->error("Value $name not found in values");
561 if ( ! is_null($value) && $value !== $this->values[$name]) {
562 $this->error("Value $name is {$this->values[$name]} but expected $value");
564 return $this;
574 return $this->values;
584 var_dump($this->values);