public function testGetUniqueFilename() { $filename = $this->dir . 'foo.txt'; touch($new = $this->downloader->getUniqueFilename($filename)); $this->assertEquals($this->dir . 'foo.txt', $new); touch($new = $this->downloader->getUniqueFilename($filename)); $this->assertEquals($this->dir . 'foo[1].txt', $new); $this->assertEquals($this->dir . 'foo[2].txt', $this->downloader->getUniqueFilename($filename)); }