it("returns `true` type is `'skipped'`", function () { $log = new Log(['type' => 'skipped']); expect($log->passed())->toBe(true); }); it("returns `true` type is `'excluded'`", function () { $log = new Log(['type' => 'excluded']); expect($log->passed())->toBe(true); }); it("returns `false` type is `'failed'`", function () { $log = new Log(['type' => 'failed']); expect($log->passed())->toBe(false); }); it("returns `false` type is `'errored'`", function () { $log = new Log(['type' => 'errored']); expect($log->passed())->toBe(false); }); it("returns `true` when logged exceptions passed", function () { $log = new Log(); $log->add('passed', []); $log->add('passed', []); expect($log->passed())->toBe(true); }); it("returns `false` when some logged exceptions failed", function () { $log = new Log(); $log->add('passed', []); $log->add('passed', []); $log->add('failed', []); expect($log->passed())->toBe(false); }); }); });
it("gets the total number of specs", function () { $this->result->log(new Log(['type' => 'passed'])); $this->result->log(new Log(['type' => 'pending'])); $this->result->log(new Log(['type' => 'skipped'])); $this->result->log(new Log(['type' => 'excluded'])); $this->result->log(new Log(['type' => 'failed'])); $this->result->log(new Log(['type' => 'errored'])); expect($this->result->total())->toBe(6); }); }); describe("->expectation()", function () { it("gets the total number of expectations", function () { $log1 = new Log(); $log1->add('passed', []); $log1->add('passed', []); $log2 = new Log(); $log2->add('failed', []); $log1->add('passed', []); $log2->add('failed', []); $log2->add('failed', []); $log2->add('failed', []); $this->result->log($log1); $this->result->log($log2); expect($this->result->expectation())->toBe(7); }); }); describe("->__call()", function () { it("gets number of passed specs", function () { $this->result->log(new Log(['type' => 'passed'])); expect($this->result->passed())->toBe(1); });