public function testGetCachedShouldCreateLocalCopyOfRemoteFile() { $cachedir = Papercite::getCacheDirectory(); $p = new Papercite(); $url = "https://gist.githubusercontent.com/bpiwowar/9793f4e2da48dfb34cde/raw/5fbff41218107aa9dcfab4fc53fe8e2b86ea8416/test.bib"; $cached = $p->getCached($url); $name = strtolower(preg_replace("@[/:]@", "_", $url)); $this->assertNotEmpty($cached); $this->assertTrue(file_exists($cached[0])); $this->assertTrue(file_exists($cachedir . '/' . $name . '.bib')); }