| Total Complexity | 2 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | final class SelfSchedulingCommandTest extends TestCase |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @test |
||
| 19 | */ |
||
| 20 | public function commands_can_self_schedule() |
||
| 21 | { |
||
| 22 | $command = new class() extends Command implements SelfSchedulingCommand { |
||
| 23 | protected static $defaultName = 'my:command'; |
||
| 24 | |||
| 25 | public function schedule(CommandTask $task): void |
||
| 26 | { |
||
| 27 | } |
||
| 28 | }; |
||
| 29 | |||
| 30 | $tasks = (new MockScheduleBuilder()) |
||
| 31 | ->addSubscriber(new SelfSchedulingCommandSubscriber([$command])) |
||
| 32 | ->getRunner() |
||
| 33 | ->buildSchedule() |
||
| 34 | ->all() |
||
| 35 | ; |
||
| 36 | |||
| 37 | $this->assertInstanceOf(CommandTask::class, $tasks[0]); |
||
| 38 | $this->assertSame('CommandTask: my:command', (string) $tasks[0]); |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @test |
||
| 43 | */ |
||
| 44 | public function throws_exception_if_not_a_command() |
||
| 58 | ; |
||
| 59 | } |
||
| 60 | } |
||
| 61 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths