}); describe("->stop()", function () { it("does nothing if not the collector has not been started", function () { expect($this->collector->stop())->toBe(false); }); it("does nothing if not the collector has not been started", function () { $this->parent->start(); $this->child->start(); expect($this->parent->stop())->toBe(false); // Required to leave Kahlan in stable state when runned with some coverage reporting. $this->child->stop(); $this->parent->stop(); }); }); describe("->metrics()", function () { it("returns the metrics", function () { $code = new CodeCoverage(); $this->collector->start(); $code->shallPass(); $this->collector->stop(); $metrics = $this->collector->metrics(); expect($metrics)->toBeAnInstanceOf('Kahlan\\Reporter\\Coverage\\Metrics'); }); }); describe("->realpath()", function () { it("supports special chars", function () { $collector = new Collector(['driver' => $this->driver, 'path' => $this->path, 'prefix' => '/a/weird~cache/path']); expect($collector->realpath('/a/weird~cache/path/home/user/project/src/filename.php'))->toBe('/home/user/project/src/filename.php'); }); }); });