public function testStrippingPaths() { $fixture = $this->getJsonFixture('backtraces/exception_handler.json'); $this->config->setStripPath("/Users/james/src/bugsnag/bugsnag-php/"); $stacktrace = Bugsnag_Stacktrace::fromBacktrace($this->config, $fixture['backtrace'], $fixture['file'], $fixture['line'])->toArray(); $this->assertCount(3, $stacktrace); $this->assertFrameEquals($stacktrace[0], "crashy_function", "testing.php", 25); $this->assertFrameEquals($stacktrace[1], "parent_of_crashy_function", "testing.php", 13); $this->assertFrameEquals($stacktrace[2], "[main]", "testing.php", 28); }
/** * Set the absolute split path. * * This is the path that should be stripped from the beginning of any * stacktrace file line. This helps to normalise filenames for grouping * and reduces the noise in stack traces. * * @param string $stripPath the path to strip from filenames * * @return $this */ public function setStripPath($stripPath) { $this->config->setStripPath($stripPath); return $this; }