Passed
Push — master ( b0febc...99b0a5 )
by Jakub
01:55
created

JobTest::testGetCallback()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MyTester;
6
7
use MyTester\Attributes\TestSuite;
8
9
/**
10
 * Test suite for class Job
11
 *
12
 * @author Jakub Konečný
13
 */
14
#[TestSuite("JobTest")]
15
final class JobTest extends TestCase
16
{
17
    public function assertSame(mixed $expected, mixed $actual): void
18
    {
19
        parent::assertSame($expected, $actual);
20
    }
21
22
    public function testResult(string $text, bool $success = true): void
23
    {
24
        parent::testResult($text, $success);
25
    }
26
27
    public function testGetCallback(): void
28
    {
29
        $callback = "var_dump";
30
        $job = new Job("Test Job", $callback);
31
        parent::assertSame($callback, $job->callback);
32
    }
33
34
    protected function getJobs(): array
35
    {
36
        $test = new TestJobs($this);
37
        $job = new Job("Test Job", [$test, "test"]);
38
        $params = [
39
            ["abc"], "def"
40
        ];
41
        $job2 = new Job("Test Job with Params", [$test, "testParams"], $params);
42
        $job3 = new Job("Test Skipped Job", [$test, "test"], [], true);
43
        return [$job, $job2, $job3];
44
    }
45
}
46