• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

orchestral / testbench-core / 11968150625

22 Nov 2024 07:13AM UTC coverage: 91.991% (+0.7%) from 91.321%
11968150625

Pull #265

github

crynobone
[7.x] Allow to configure `tty` via `Orchestra\Testbench\remote()`
function

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Pull Request #265: [7.x] Allow to configure `tty` via `Orchestra\Testbench\remote()`

3 of 4 new or added lines in 1 file covered. (75.0%)

93 existing lines in 25 files now uncovered.

1206 of 1311 relevant lines covered (91.99%)

61.99 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

77.78
/src/Foundation/Bootstrap/LoadEnvironmentVariablesFromArray.php
1
<?php
2

3
namespace Orchestra\Testbench\Foundation\Bootstrap;
4

5
use Dotenv\Parser\Parser;
6
use Dotenv\Store\StringStore;
7
use Illuminate\Contracts\Foundation\Application;
8
use Illuminate\Support\Collection;
9
use Orchestra\Testbench\Foundation\Env;
10

11
/**
12
 * @internal
13
 */
14
final class LoadEnvironmentVariablesFromArray
15
{
16
    /**
17
     * The environment variables.
18
     *
19
     * @var array<int, mixed>
20
     */
21
    public $environmentVariables;
22

23
    /**
24
     * Construct a new Create Vendor Symlink bootstrapper.
25
     *
26
     * @param  array<int, mixed>  $environmentVariables
27
     */
28
    public function __construct(array $environmentVariables)
29
    {
30
        $this->environmentVariables = $environmentVariables;
7✔
31
    }
32

33
    /**
34
     * Bootstrap the given application.
35
     *
36
     * @param  \Illuminate\Contracts\Foundation\Application  $app
37
     * @return void
38
     */
39
    public function bootstrap(Application $app): void
40
    {
41
        $store = new StringStore(implode(PHP_EOL, $this->environmentVariables));
7✔
42
        $parser = new Parser;
7✔
43

44
        Collection::make($parser->parse($store->read()))
7✔
45
            ->filter(static function ($entry) {
7✔
46
                /** @var \Dotenv\Parser\Entry $entry */
UNCOV
47
                return $entry->getValue()->isDefined();
×
48
            })->each(static function ($entry) {
7✔
49
                /** @var \Dotenv\Parser\Entry $entry */
UNCOV
50
                Env::set($entry->getName(), $entry->getValue()->get()->getChars());
×
51
            });
7✔
52
    }
53
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc