コード例 #1
0
ファイル: CleanupTest.php プロジェクト: alibo/php-backup
 /**
  * @test
  */
 public function cleans_collection()
 {
     $backup = new Backup($this->dropboxInstance(), $this->working);
     $backup->addJob(new Job(new File($this->terms_file(), $this->assets)));
     $backup->prepare();
     $backup->processFiles();
     $archive = new Archive($backup, new ZipArchive());
     $archive->execute();
     $this->assertCount(1, $backup->getCollection(), 'Collection does not contain 1 item');
     $this->assertFileExists($backup->archivePath());
     $cleanup = new Cleanup($backup);
     $cleanup->execute();
     $this->assertEmpty($backup->getCollection(), 'Collection is not empty');
     $this->assertFileNotExists($backup->archivePath());
 }
コード例 #2
0
ファイル: Backup.php プロジェクト: alibo/php-backup
 /**
  * Remove all files.
  *
  * @return void
  */
 private function cleanup()
 {
     $cleanup = new CleanupProcessor($this);
     $cleanup->execute();
     if ($this->noOfBackups !== 0) {
         $cleanup->clearOutdated();
     }
 }