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

orchestral / testbench-core / 7147460739

08 Dec 2023 11:48PM UTC coverage: 92.071% (-0.6%) from 92.706%
7147460739

Pull #166

github

crynobone
wip

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Pull Request #166: PestPHP Improvements

78 of 91 new or added lines in 7 files covered. (85.71%)

5 existing lines in 3 files now uncovered.

1138 of 1236 relevant lines covered (92.07%)

45.17 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 PHPUnit\Framework\TestCase as PHPUnitTestCase;
9

10
trait HandlesTestingFeature
11
{
12
    /**
13
     * Resolve available testing features for Testbench.
14
     *
15
     * @param  (\Closure():(void))|null  $default
16
     * @param  (\Closure():(void))|null  $annotation
17
     * @param  (\Closure():(mixed))|null  $attribute
18
     * @param  (\Closure():(mixed))|null  $pest
19
     * @return \Illuminate\Support\Fluent<array-key, mixed>
20
     */
21
    protected function resolveTestbenchTestingFeature(
22
        ?Closure $default = null,
23
        ?Closure $annotation = null,
24
        ?Closure $attribute = null,
25
        ?Closure $pest = null
26
    ) {
27
        /** @var \Illuminate\Support\Fluent{?attribute: null} $result */
28
        $result = new Fluent();
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
        /** @phpstan-ignore-next-line */
39
        if ($this instanceof PHPUnitTestCase && static::usesTestingConcern(WithPest::class)) {
119✔
NEW
40
            value($pest);
×
41
        }
42

43
        value($default);
119✔
44

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