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()); }
public function testSet() { $this->database->set('version', '1.0'); $this->assertEquals(['name' => 'nanbando', 'version' => '1.0'], $this->database->getAll()); }