| @@ 79-97 (lines=19) @@ | ||
| 76 | /** |
|
| 77 | * @test |
|
| 78 | */ |
|
| 79 | public function existingValueIsKeptIfRequested() |
|
| 80 | { |
|
| 81 | /** @var MethodProphecy $ask */ |
|
| 82 | $ask = $this->questionHelper->ask(Argument::cetera())->willReturn(true); |
|
| 83 | ||
| 84 | $config = new CustomizableAppConfig(); |
|
| 85 | $config->setLanguage([ |
|
| 86 | 'DEFAULT' => 'es', |
|
| 87 | 'CLI' => 'es', |
|
| 88 | ]); |
|
| 89 | ||
| 90 | $this->plugin->process(new ArrayInput([]), new NullOutput(), $config); |
|
| 91 | ||
| 92 | $this->assertEquals([ |
|
| 93 | 'DEFAULT' => 'es', |
|
| 94 | 'CLI' => 'es', |
|
| 95 | ], $config->getLanguage()); |
|
| 96 | $ask->shouldHaveBeenCalledTimes(1); |
|
| 97 | } |
|
| 98 | } |
|
| 99 | ||
| @@ 35-51 (lines=17) @@ | ||
| 32 | /** |
|
| 33 | * @test |
|
| 34 | */ |
|
| 35 | public function configIsRequestedToTheUser() |
|
| 36 | { |
|
| 37 | /** @var MethodProphecy $askSecret */ |
|
| 38 | $askSecret = $this->questionHelper->ask(Argument::cetera())->willReturn('something'); |
|
| 39 | $config = new CustomizableAppConfig(); |
|
| 40 | ||
| 41 | $this->plugin->process(new ArrayInput([]), new NullOutput(), $config); |
|
| 42 | ||
| 43 | $this->assertTrue($config->hasUrlShortener()); |
|
| 44 | $this->assertEquals([ |
|
| 45 | 'SCHEMA' => 'something', |
|
| 46 | 'HOSTNAME' => 'something', |
|
| 47 | 'CHARS' => 'something', |
|
| 48 | 'VALIDATE_URL' => 'something', |
|
| 49 | ], $config->getUrlShortener()); |
|
| 50 | $askSecret->shouldHaveBeenCalledTimes(4); |
|
| 51 | } |
|
| 52 | ||
| 53 | /** |
|
| 54 | * @test |
|