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

orchestral / testbench-core / 7147334637

08 Dec 2023 11:25PM UTC coverage: 92.358% (-0.3%) from 92.706%
7147334637

Pull #166

github

crynobone
wip

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

76 of 85 new or added lines in 7 files covered. (89.41%)

3 existing lines in 2 files now uncovered.

1136 of 1230 relevant lines covered (92.36%)

45.2 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\Hook;
8
use Orchestra\Testbench\Pest\WithPest;
9
use Pest\TestSuite;
10
use PHPUnit\Framework\TestCase as PHPUnitTestCase;
11

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

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

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

39
        if ($this instanceof PHPUnitTestCase && static::usesTestingConcern(WithPest::class)) {
119✔
NEW
40
            value($pest);
×
41
        }
42

43
        value($testCase);
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