| Conditions | 1 |
| Total Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function testEditEmptyFile() |
||
| 14 | { |
||
| 15 | // Make sure no file is present |
||
| 16 | if(file_exists($this->getFilePathForEnvironment('testing'))) { |
||
| 17 | unlink($this->getFilePathForEnvironment('testing')); |
||
| 18 | } |
||
| 19 | |||
| 20 | // Setup a driver that fails if we call the encrypt method. |
||
| 21 | EnvSecurity::extend('failonencrypt', function() { |
||
| 22 | return new class { |
||
| 23 | public function encrypt($plaintext) { |
||
| 24 | throw new \Exception('Should not be here. I received: ' . $plaintext); |
||
| 25 | } |
||
| 26 | }; |
||
| 27 | }); |
||
| 28 | Config::set('env-security.default', 'failonencrypt'); |
||
| 29 | |||
| 30 | // Our test double will output the plaintext |
||
| 31 | $this->artisan('env:edit testing') |
||
| 32 | ->expectsOutput('Plaintext contents: '); |
||
| 33 | |||
| 34 | // File should be empty |
||
| 35 | $this->assertEquals('', $this->loadEncrypted('testing')); |
||
| 36 | } |
||
| 50 | } |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths