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

orchestral / testbench-core / 12275739325

11 Dec 2024 11:49AM UTC coverage: 91.562% (+0.006%) from 91.556%
12275739325

Pull #275

github

web-flow
Merge 66037109c into cb3e56a7f
Pull Request #275: [7.x] Override `vendor:publish` command for Testbench CLI

2 of 2 new or added lines in 2 files covered. (100.0%)

1 existing line in 1 file now uncovered.

1237 of 1351 relevant lines covered (91.56%)

63.85 hits per line

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

91.67
/src/Foundation/Console/Actions/Action.php
1
<?php
2

3
namespace Orchestra\Testbench\Foundation\Console\Actions;
4

5
use function Orchestra\Testbench\package_path;
6

7
/**
8
 * @api
9
 */
10
abstract class Action
11
{
12
    /**
13
     * Working path for the action.
14
     *
15
     * @var string|null
16
     */
17
    public $workingPath;
18

19
    /**
20
     * Normalise file location.
21
     *
22
     * @param  string  $path
23
     * @return string
24
     */
25
    protected function pathLocation(string $path): string
26
    {
27
        $packagePath = package_path();
11✔
28

29
        if (! \is_null($this->workingPath)) {
11✔
30
            $path = str_replace(rtrim($this->workingPath, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR, '', $path);
4✔
31

32
            $prefix = match ($this->workingPath) {
4✔
33
                app()->basePath() => '@laravel',
4✔
34
                $packagePath => '.',
4✔
35
                default => '@'
4✔
36
            };
4✔
37

38
            return implode('/', [$prefix, ltrim($path, '/')]);
4✔
39
        }
40

41

42
        if (str_starts_with($path, $packagePath)) {
7✔
UNCOV
43
            return sprintf('./%s', ltrim(str_replace($packagePath, '', $path), '/'));
×
44
        }
45

46
        return $path;
7✔
47
    }
48
}
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