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

orchestral / testbench-core / 14039631419

24 Mar 2025 03:45PM UTC coverage: 91.878% (-0.9%) from 92.776%
14039631419

Pull #329

github

web-flow
Merge 8ece9e2f3 into ce7418771
Pull Request #329: [7.x] Add support for `workbench/bootstrap/providers.php`

28 of 45 new or added lines in 3 files covered. (62.22%)

5 existing lines in 1 file now uncovered.

1414 of 1539 relevant lines covered (91.88%)

63.24 hits per line

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

85.71
/src/Concerns/WithLaravelBootstrapFile.php
1
<?php
2

3
namespace Orchestra\Testbench\Concerns;
4

5
use Orchestra\Testbench\Foundation\Application as Testbench;
6

7
use function Orchestra\Sidekick\join_paths;
8
use function Orchestra\Testbench\workbench_path;
9

10
trait WithLaravelBootstrapFile
11
{
12
    use InteractsWithTestCase;
13

14
    /**
15
     * Get application bootstrap file path (if exists).
16
     *
17
     * @internal
18
     *
19
     * @param  string  $filename
20
     * @return string|false
21
     */
22
    protected function getApplicationBootstrapFile(string $filename): string|false
23
    {
24
        $bootstrapFile = realpath(join_paths($this->getApplicationBasePath(), 'bootstrap', $filename));
170✔
25

26
        if ($this->usesTestbenchDefaultSkeleton()) {
170✔
27
            if (static::usesTestingConcern(WithWorkbench::class) || $this instanceof Testbench) {
170✔
28
                return is_file($workbenchFile = workbench_path(join_paths('bootstrap', $filename))) ? (string) realpath($workbenchFile) : false;
43✔
29
            }
30

31
            return false;
135✔
32
        }
33

NEW
34
        return $bootstrapFile;
×
35
    }
36

37
    /**
38
     * Determine if application is bootstrapped using Testbench's default skeleton.
39
     *
40
     * @return bool
41
     */
42
    protected function usesTestbenchDefaultSkeleton(): bool
43
    {
44
        return realpath(join_paths($this->getApplicationBasePath(), 'bootstrap', '.testbench-default-skeleton')) !== false;
170✔
45
    }
46

47
    /**
48
     * Get the application's base path.
49
     *
50
     * @api
51
     *
52
     * @return string
53
     */
54
    abstract protected function getApplicationBasePath();
55
}
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