Exemplo n.º 1
0
 public function testOnBackupFinishedFailed()
 {
     $this->event->getStatus()->willReturn(BackupStatus::STATE_FAILED);
     $this->event->getException()->willReturn(new \Exception());
     $this->database->set('finished', Argument::that(function ($value) {
         $date = \DateTime::createFromFormat(\DateTime::RFC3339, $value);
         return new \DateTime() >= $date;
     }))->shouldBeCalled();
     $this->database->set('state', BackupStatus::STATE_FAILED)->shouldBeCalled();
     $this->database->set('exception', Argument::any())->shouldBeCalled();
     $this->listener->onBackupFinished($this->event->reveal());
 }
Exemplo n.º 2
0
 public function testRemoveNotExists()
 {
     $this->database->remove('version');
     $this->assertEquals(['name' => 'nanbando'], $this->database->getAll());
 }