ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
BasicTaskManagerTest.php
Go to the documentation of this file.
1<?php
10
21use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
22
24{
25 use MockeryPHPUnitIntegration;
26
27 protected $taskManager;
28 protected $bucket;
29
30 public function setUp()
31 {
32 $persistence = \Mockery::mock(BasicPersistence::class);
33 $this->taskManager = new SyncTaskManager($persistence);
34 }
35
36 public function testBasicTaskManager()
37 {
38 $dic = new Container();
39
40 $factory = new Injector($dic, new EmptyDependencyMap());
41
42 $bucket = new BasicBucket();
43 $bucket->setUserId(3);
44 $bucket->setState(State::SCHEDULED);
45
47 $a = $factory->createInstance(PlusJob::class);
49 $b = $factory->createInstance(PlusJob::class);
51 $c = $factory->createInstance(PlusJob::class);
52
53 $a->setInput([1, 1]);
54 $b->setInput([1, 1]);
55 $c->setInput([$a, $b]);
56
58 $userInteraction = $factory->createInstance(DownloadInteger::class);
59 $userInteraction->setInput([$c]);
60
61 $bucket->setTask($userInteraction);
62
63 $this->bucket = $bucket;
64 }
65}
$factory
Definition: metadata.php:43
An exception for terminatinating execution or to throw for unit testing.
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:17