public function testLastExtension() { $this->assertTrue(CFilePath::lastExtension("/path/to/file.png")->equals("png")); $this->assertTrue(CFilePath::lastExtension("/path/to/file.tar.gz")->equals("gz")); $this->assertTrue(CFilePath::lastExtension("/path/to/file.sql.tar.gz")->equals("gz")); $this->assertTrue(CFilePath::lastExtension("/path/t.o/file")->equals("")); $this->assertTrue(CFilePath::lastExtension("/path/t.o/dir")->equals("")); $this->assertTrue(CFilePath::lastExtension("/path/t.o/dir/")->equals("")); $this->assertTrue(CFilePath::lastExtension("/path/t.o/dir//")->equals("")); $this->assertTrue(CFilePath::lastExtension("file.png")->equals("png")); $this->assertTrue(CFilePath::lastExtension("file")->equals("")); $this->assertTrue(CFilePath::lastExtension("dir")->equals("")); $this->assertTrue(CFilePath::lastExtension("/")->equals("")); $this->assertTrue(CFilePath::lastExtension(".")->equals("")); $this->assertTrue(CFilePath::lastExtension("..")->equals("")); }