Пример #1
0
 protected function setUp()
 {
     $this->container = $this->prophesize(ContainerInterface::class);
     $this->plugins = $this->prophesize(PluginRegistry::class);
     $this->presetStore = $this->prophesize(PresetStore::class);
     $this->presetStore->getPreset(Argument::cetera())->willReturn([]);
 }
Пример #2
0
 public function testOnPreRestore()
 {
     $event = $this->prophesize(PreRestoreEvent::class);
     $event->getBackup()->willReturn(['test1' => 1, 'test2' => 2]);
     $event->setBackup(['test1' => 1, 'test2' => 2, 'test3' => 3])->shouldBeCalled();
     $this->presetStore->getPreset($this->application, $this->version, $this->options)->willReturn(['test2' => 3, 'test3' => 3]);
     $this->listener->onPreRestore($event->reveal());
 }
Пример #3
0
 /**
  * Extend backup with preset.
  *
  * @param array $backup
  *
  * @return array
  */
 private function extend(array $backup)
 {
     $preset = $this->presetStore->getPreset($this->application, $this->version, $this->options);
     return array_merge($preset, $backup);
 }
Пример #4
0
 /**
  * @dataProvider presetProvider
  *
  * @param array $presets
  * @param string $application
  * @param string $version
  * @param array|null $options
  * @param array $expects
  */
 public function testGetPreset($presets, $application, $version, $options, $expects)
 {
     $presetStore = new PresetStore($presets);
     $this->assertEquals($expects, $presetStore->getPreset($application, $version, $options));
 }