kahlan\Specification::__construct PHP Method

__construct() public method

Constructor.
public __construct ( array $config = [] )
$config array The Suite config array. Options are: -`'closure'` _Closure_ : the closure of the test. -`'message'` _string_ : the spec message. -`'scope'` _string_ : supported scope are `'normal'` & `'focus'`.
    public function __construct($config = [])
    {
        $defaults = ['closure' => null, 'message' => 'passes'];
        $config += $defaults;
        $config['message'] = 'it ' . $config['message'];
        parent::__construct($config);
        $config['closure'] = $config['closure'] ?: function () {
        };
        $this->_closure = $this->_bind($config['closure'], 'it');
        if ($this->_type === 'focus') {
            $this->_emitFocus();
        }
    }