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

orchestral / testbench-core / 7147240485

08 Dec 2023 11:11PM UTC coverage: 92.439% (-0.3%) from 92.706%
7147240485

Pull #166

github

web-flow
Merge 1af27d42c into 4565dc280
Pull Request #166: PestPHP Improvements

77 of 85 new or added lines in 7 files covered. (90.59%)

2 existing lines in 2 files now uncovered.

1137 of 1230 relevant lines covered (92.44%)

45.29 hits per line

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

88.89
/src/Concerns/HandlesTestingFeature.php
1
<?php
2

3
namespace Orchestra\Testbench\Concerns;
4

5
use Closure;
6
use Illuminate\Support\Fluent;
7
use Orchestra\Testbench\Pest\WithPest;
8
use Pest\TestSuite;
9
use PHPUnit\Framework\TestCase as PHPUnitTestCase;
10

11
trait HandlesTestingFeature
12
{
13
    /**
14
     * Resolve available testing features for Testbench.
15
     *
16
     * @param  (\Closure():(void))|null  $testCase
17
     * @param  (\Closure():(void))|null  $annotation
18
     * @param  (\Closure():(mixed))|null  $attribute
19
     * @param  string|null  $pest
20
     * @return \Illuminate\Support\Fluent<array-key, mixed>
21
     */
22
    protected function resolveTestbenchTestingFeature(
23
        ?Closure $testCase = null,
24
        ?Closure $annotation = null,
25
        ?Closure $attribute = null,
26
        ?string $pest = null
27
    ) {
28
        $result = new Fluent(['attribute' => null]);
119✔
29

30
        if ($this instanceof PHPUnitTestCase && static::usesTestingConcern(HandlesAnnotations::class)) {
119✔
31
            value($annotation);
114✔
32
        }
33

34
        if ($this instanceof PHPUnitTestCase && static::usesTestingConcern(HandlesAttributes::class)) {
119✔
35
            $result->attribute = value($attribute);
114✔
36
        }
37

38
        if ($this instanceof PHPUnitTestCase && static::usesTestingConcern(WithPest::class) && is_string($pest)) {
119✔
NEW
39
            value(Hook::unpack($pest, TestSuite::getInstance()->getFilename()));
×
40
        }
41

42
        value($testCase);
119✔
43

44
        return $result;
119✔
45
    }
46
}
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