/** * Test the Backup collector with no dynamic directory * Files not matching foo-%d.txt.zip should be ignored. */ public function testMatchFilesCompressed() { $path = $this->getTestDataDir() . '/collector/static-dir-compressed'; $filename = 'foo-%d.txt'; $target = new Target($path, $filename, strtotime('2014-12-01 04:30:57')); $target->setCompressor($this->getCompressorMockForCmd('zip', 'zip')); $collector = new Collector($target); $files = $collector->getBackupFiles(); $this->assertEquals(4, count($files), '4 files should be found'); }
/** * Tests Target::getPathnamePlain */ public function testGetPathnamePlain() { $path = '/tmp/%m/%d'; $filename = 'foo.txt'; $target = new Target($path, $filename, strtotime('2014-12-01 04:30:57')); $this->assertEquals('/tmp/12/01/foo.txt', $target->getPathnamePlain()); $target->setCompressor($this->getCompressorMockForCmd('zip', 'zip', 'application/zip')); $this->assertEquals('/tmp/12/01/foo.txt', $target->getPathnamePlain()); }