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

orchestral / workbench / 12509286075

26 Dec 2024 11:04PM UTC coverage: 92.868% (-1.0%) from 93.842%
12509286075

push

github

crynobone
fixes tests

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

11 of 12 new or added lines in 2 files covered. (91.67%)

24 existing lines in 3 files now uncovered.

586 of 631 relevant lines covered (92.87%)

17.17 hits per line

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

93.75
/src/Workbench.php
1
<?php
2

3
namespace Orchestra\Workbench;
4

5
use Illuminate\Support\Arr;
6

7
use function Orchestra\Testbench\join_paths;
8
use function Orchestra\Testbench\package_path;
9
use function Orchestra\Testbench\workbench;
10
use function Orchestra\Testbench\workbench_path;
11

12
/**
13
 * @phpstan-import-type TWorkbenchConfig from \Orchestra\Testbench\Foundation\Config
14
 */
15
class Workbench extends \Orchestra\Testbench\Workbench\Workbench
16
{
17
    /**
18
     * The Stub Registrar instance.
19
     */
20
    protected static ?StubRegistrar $stubRegistrar = null;
21

22
    /**
23
     * Get the path to the application (Laravel) folder.
24
     *
25
     * @no-named-arguments
26
     */
27
    public static function applicationPath(array|string $path = ''): string
28
    {
29
        return base_path(
1✔
30
            join_paths(...Arr::wrap(\func_num_args() > 1 ? \func_get_args() : $path))
1✔
31
        );
1✔
32
    }
33

34
    /**
35
     * Get the path to the Laravel application skeleton.
36
     *
37
     * @no-named-arguments
38
     *
39
     * @see \Orchestra\Workbench\Workbench::applicationPath()
40
     */
41
    public static function laravelPath(array|string $path = ''): string
42
    {
43
        return static::applicationPath($path);
1✔
44
    }
45

46
    /**
47
     * Get the path to the package folder.
48
     *
49
     * @no-named-arguments
50
     */
51
    public static function packagePath(array|string $path = ''): string
52
    {
53
        return package_path(
20✔
54
            ...Arr::wrap(\func_num_args() > 1 ? \func_get_args() : $path)
20✔
55
        );
20✔
56
    }
57

58
    /**
59
     * Get the path to the workbench folder.
60
     *
61
     * @no-named-arguments
62
     */
63
    public static function path(array|string $path = ''): string
64
    {
65
        return workbench_path(
21✔
66
            ...Arr::wrap(\func_num_args() > 1 ? \func_get_args() : $path)
21✔
67
        );
21✔
68
    }
69

70
    /**
71
     * Get the availale configuration.
72
     *
73
     * @return array<string, mixed>|mixed
74
     *
75
     * @phpstan-return ($key is null ? TWorkbenchConfig : mixed)
76
     */
77
    public static function config(?string $key = null): mixed
78
    {
79
        return ! \is_null($key)
42✔
80
            ? Arr::get(workbench(), $key)
11✔
81
            : workbench();
42✔
82
    }
83

84
    /**
85
     * Retrieve Stub Registrar instance.
86
     */
87
    public static function stub(): StubRegistrar
88
    {
89
        return static::$stubRegistrar ??= new StubRegistrar;
31✔
90
    }
91

92
    /**
93
     * Swap stub file by name.
94
     */
95
    public static function swapFile(string $name, ?string $file): void
96
    {
UNCOV
97
        static::stub()->swap($name, $file);
×
98
    }
99

100
    /**
101
     * Retrieve the stub file from name.
102
     */
103
    public static function stubFile(string $name): ?string
104
    {
105
        return static::stub()->file($name);
31✔
106
    }
107
}
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

© 2025 Coveralls, Inc