/** * Cleanup failed event. * * @param \phpbu\App\Configuration\Backup\Cleanup $cleanup */ public function cleanupFailed(Configuration\Backup\Cleanup $cleanup) { $this->cleanupsFailed++; $this->backupActive->cleanupFailed($cleanup); $event = new Event\Cleanup\Failed($cleanup); $this->eventDispatcher->dispatch(Event\Cleanup\Failed::NAME, $event); }
/** * Test Cleanup handling. */ public function testCleanup() { $cleanup = new Configuration\Backup\Cleanup('capacity', false); $backup = new Backup('name'); $backup->cleanupAdd($cleanup); $backup->cleanupFailed($cleanup); $backup->cleanupSkipped($cleanup); $this->assertEquals(1, $backup->cleanupCountFailed()); $this->assertEquals(1, $backup->cleanupCountSkipped()); $this->assertEquals(1, $backup->cleanupCount()); }