public getFileWithoutPath ( ) : string | ||
return | string | The name of the file, not including the path. |
public function getFileWithoutPath()
{
if (preg_match("/\\/\$/", $this->m_file)) {
trigger_error($this->invalidParam);
}
return preg_replace("/.*\\/([^\\/]*)/", "\$1", $this->m_file);
}
function test_trailingSlashInFile() { $reporter = new BugReporter (2, "bad bad error", "/non-dir/file.php", 3, "Campsite", "2.5.0"); $reporter->m_file .= "/"; $reporter->getFileWithoutPath(); $this->assertError(); }