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;
162 $rawData = $this->getBody('application/json');
165 $this->error(
171 return $this;
175 $this->error(
179 return $this;
187 return $this->expectBody('');
200 $this->checkHeader($name, $value, $useRegex);
202 return $this;
211 $this->checkNoHeader($name);
213 return $this;
225 $errorData = $this->getErrorData();
230 $this->error($expectedErrorMessage);
233 return $this;
245 $errorData = $this->getErrorData();
247 $this->error(
250 $this->debugOutput();
253 return $this;
264 $headers = $this->getHeaders();
266 return $this;
269 $this->error('Status is expected but not supplied');
272 $this->error("Status is $statusMessage but the actual value is {$headers['status']}");
275 return $this;
284 return $this->expectStatus(null);
294 return $this->expectError(null);
306 if ($this->checkIfValid() && $this->checkDefaultHeaders($contentType)) {
307 return $this->rawBody;
320 var_dump($this->getBody($contentType));
330 echo $this->getBody($contentType) . "\n";
340 echo $this->data['out_response'] . "\n";
342 echo $this->data['err_response'] . "\n";
345 $this->debugOutputted = true;
353 return $this->data['err_response'];
363 if ($this->isValid()) {
367 if ( ! $this->expectInvalid) {
368 $this->error("The response is invalid: $this->rawData");
385 ( ! ini_get('expose_php') || $this->checkHeader('X-Powered-By', '|^PHP/8|', true)) &&
386 $this->checkHeader('Content-type', '|^' . $contentType . '(;\s?charset=\w+)?|', true)
402 $headers = $this->getHeaders();
404 return $this->error("The header $name is not present");
413 return $this->error("The header $name value '$header' is not the same as '$value'");
417 return $this->error("The header $name value '$header' does not match RegExp '$value'");
430 $headers = $this->getHeaders();
432 return $this->error("The header $name is present");
445 if ( ! $this->isValid()) {
449 if (is_array($this->headers)) {
450 return $this->headers;
453 $headerRows = explode("\r\n", $this->rawHeaders);
458 $this->error("Invalid header row (no colon): $headerRow");
465 return ($this->headers = $headers);
473 if ($this->valid === null) {
474 $this->processData();
477 return $this->valid;
485 $this->rawData = $this->data['out_response'];
486 $this->valid = (
487 ! is_null($this->rawData) &&
488 strpos($this->rawData, self::HEADER_SEPARATOR)
490 if ($this->valid) {
491 list ($this->rawHeaders, $this->rawBody) = array_map(
493 explode(self::HEADER_SEPARATOR, $this->rawData)
517 $this->error('Invalid values supplied', true);
519 $this->values = [];
521 $this->values = $values;
535 if ( ! isset($this->values[$name])) {
536 $this->error("Value $name not found in values");
538 if ( ! is_null($value) && $value !== $this->values[$name]) {
539 $this->error("Value $name is {$this->values[$name]} but expected $value");
541 return $this;
551 return $this->values;
561 var_dump($this->values);