zenstruck /
schedule-bundle
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Zenstruck\ScheduleBundle\Tests\Schedule; |
||
| 4 | |||
| 5 | use PHPUnit\Framework\TestCase; |
||
|
0 ignored issues
–
show
|
|||
| 6 | use Zenstruck\ScheduleBundle\Schedule; |
||
| 7 | use Zenstruck\ScheduleBundle\Schedule\ScheduleRunContext; |
||
| 8 | use Zenstruck\ScheduleBundle\Schedule\Task\Result; |
||
| 9 | use Zenstruck\ScheduleBundle\Schedule\Task\TaskRunContext; |
||
| 10 | use Zenstruck\ScheduleBundle\Tests\Fixture\MockTask; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @author Kevin Bond <[email protected]> |
||
| 14 | */ |
||
| 15 | final class ScheduleRunContextTest extends TestCase |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @test |
||
| 19 | */ |
||
| 20 | public function cannot_access_results_if_has_not_run() |
||
| 21 | { |
||
| 22 | $context = new ScheduleRunContext(new Schedule()); |
||
| 23 | |||
| 24 | $this->expectException(\LogicException::class); |
||
| 25 | $this->expectExceptionMessage('"The Schedule" has not yet run.'); |
||
| 26 | |||
| 27 | $context->getResults(); |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @test |
||
| 32 | */ |
||
| 33 | public function set_results_count_mismatch() |
||
| 34 | { |
||
| 35 | $scheduleRunContext = new ScheduleRunContext(new Schedule(), new MockTask(), new MockTask()); |
||
| 36 | |||
| 37 | $this->expectException(\LogicException::class); |
||
| 38 | $this->expectExceptionMessage('The number of results (1) does not match the number of due tasks (2).'); |
||
| 39 | |||
| 40 | $taskRunContext = new TaskRunContext($scheduleRunContext, new MockTask()); |
||
| 41 | $taskRunContext->setResult(Result::successful(new MockTask())); |
||
| 42 | |||
| 43 | $scheduleRunContext->setTaskRunContexts($taskRunContext); |
||
| 44 | } |
||
| 45 | } |
||
| 46 |
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