for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Zumba\Mink\Driver;
/**
* Class HeadersTrait
* @package Zumba\Mink\Driver
*/
trait HeadersTrait {
* Gets the current request response headers
* Should be called only after a request, other calls are undefined behaviour
* @return array
public function getResponseHeaders() {
return $this->browser->responseHeaders();
browser
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
}
* Current request status code response
* @return int
public function getStatusCode() {
return $this->browser->getStatusCode();
* The name say its all
* @param string $name
* @param string $value
public function setRequestHeader($name, $value) {
$header = array();
$header[$name] = $value;
//TODO: as a limitation of the driver it self, we will send permanent for the moment
$this->browser->addHeader($header, true);
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: