scope() public method

Gets the scope context of the report.
public scope ( ) : object
return object
Beispiel #1
0
<?php

namespace Kahlan\Spec\Suite;

use Exception;
use Kahlan\Log;
use Kahlan\Scope;
describe("Log", function () {
    describe("->__construct()", function () {
        it("correctly sets default values", function () {
            $log = new Log();
            expect($log->scope())->toBe(null);
            expect($log->type())->toBe('passed');
            expect($log->not())->toBe(false);
            expect($log->description())->toBe(null);
            expect($log->matcher())->toBe(null);
            expect($log->matcherName())->toBe(null);
            expect($log->data())->toBe([]);
            expect($log->backtrace())->toBe([]);
            expect($log->exception())->toBe(null);
            expect($log->file())->toBe(null);
            expect($log->line())->toBe(null);
            expect($log->children())->toBe([]);
        });
    });
    describe("->add()", function () {
        beforeEach(function () {
            $this->scope = new Scope();
            $this->pattern = '*Suite.php';
            $this->regExp = strtr(preg_quote($this->pattern, '~'), ['\\*' => '.*', '\\?' => '.']);
            $this->scope->backtraceFocus($this->pattern);