ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
BasicTaskManagerTest.php
Go to the documentation of this file.
1<?php
10
21use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
22use PHPUnit\Framework\TestCase;
23
24class BasicTaskManagerTest extends TestCase
25{
26 use MockeryPHPUnitIntegration;
27
28 protected $taskManager;
29 protected $bucket;
30
31 public function setUp() : void
32 {
33 $persistence = \Mockery::mock(BasicPersistence::class);
34 $this->taskManager = new SyncTaskManager($persistence);
35 }
36
40 public function testBasicTaskManager()
41 {
42 $dic = new Container();
43
45
46 $bucket = new BasicBucket();
47 $bucket->setUserId(3);
48 $bucket->setState(State::SCHEDULED);
49
51 $a = $factory->createInstance(PlusJob::class);
53 $b = $factory->createInstance(PlusJob::class);
55 $c = $factory->createInstance(PlusJob::class);
56
57 $a->setInput([1, 1]);
58 $b->setInput([1, 1]);
59 $c->setInput([$a, $b]);
60
62 $userInteraction = $factory->createInstance(DownloadInteger::class);
63 $userInteraction->setInput([$c]);
64
65 $bucket->setTask($userInteraction);
66
67 $this->bucket = $bucket;
68 }
69}
An exception for terminatinating execution or to throw for unit testing.
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:18
$factory
Definition: metadata.php:58
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
$dic
Definition: result.php:13