/** * 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()); }
/** * Cleanup start event. * * @param \phpbu\App\Configuration\Backup\Cleanup $cleanup */ public function cleanupStart(Configuration\Backup\Cleanup $cleanup) { $this->backupActive->cleanupAdd($cleanup); $event = new Event\Cleanup\Start($cleanup); $this->eventDispatcher->dispatch(Event\Cleanup\Start::NAME, $event); }