ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
BasicTaskManagerTest.php
Go to the documentation of this file.
1
<?php
9
namespace
BackgroundTasks\Implementation
;
10
11
use
ILIAS\BackgroundTasks\Implementation\Bucket\BasicBucket
;
12
use
ILIAS\BackgroundTasks\Implementation\Bucket\State
;
13
use
ILIAS\BackgroundTasks\Implementation\Persistence\BasicPersistence
;
14
use
ILIAS\BackgroundTasks\Implementation\TaskManager\BasicTaskManager
;
15
use
ILIAS\BackgroundTasks\Implementation\Tasks\DownloadInteger
;
16
use
ILIAS\BackgroundTasks\Implementation\Tasks\PlusJob
;
17
use
ILIAS\DI\Container
;
18
use
ILIAS\BackgroundTasks\Dependencies\DependencyMap\EmptyDependencyMap
;
19
use
ILIAS\BackgroundTasks\Dependencies\Injector
;
20
use
Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration
;
21
22
class
BasicTaskManagerTest
extends
\PHPUnit_Framework_TestCase
23
{
24
use
MockeryPHPUnitIntegration
;
25
26
protected
$taskManager
;
27
protected
$bucket
;
28
29
public
function
setUp
()
30
{
31
$persistence = \Mockery::mock(BasicPersistence::class);
32
$this->taskManager =
new
BasicTaskManager
($persistence);
33
}
34
35
public
function
testBasicTaskManager()
36
{
37
$dic =
new
Container
();
38
39
$factory
=
new
Injector
($dic,
new
EmptyDependencyMap
());
40
41
$bucket
=
new
BasicBucket
();
42
$bucket
->setUserId(3);
43
$bucket
->setState(
State::SCHEDULED
);
44
46
$a =
$factory
->createInstance(PlusJob::class);
48
$b =
$factory
->createInstance(PlusJob::class);
50
$c =
$factory
->createInstance(PlusJob::class);
51
52
$a->setInput([1, 1]);
53
$b->setInput([1, 1]);
54
$c->setInput([$a, $b]);
55
57
$userInteraction =
$factory
->createInstance(DownloadInteger::class);
58
$userInteraction->setInput([$c]);
59
60
$bucket
->setTask($userInteraction);
61
62
$this->bucket =
$bucket
;
63
}
64
}
ILIAS\BackgroundTasks\Dependencies\Injector
Definition:
Injector.php:19
BackgroundTasks\Implementation\BasicTaskManagerTest
Definition:
BasicTaskManagerTest.php:22
ILIAS\BackgroundTasks\Dependencies\DependencyMap\EmptyDependencyMap
Definition:
EmptyDependencyMap.php:15
BackgroundTasks\Implementation
Created by PhpStorm.
Definition:
BasicTaskManagerTest.php:9
BackgroundTasks\Implementation\BasicTaskManagerTest\$taskManager
$taskManager
Definition:
BasicTaskManagerTest.php:26
$factory
$factory
Definition:
metadata.php:47
BackgroundTasks\Implementation\BasicTaskManagerTest\setUp
setUp()
Definition:
BasicTaskManagerTest.php:29
PHPUnit_Framework_TestCase
MockeryPHPUnitIntegration
ILIAS\DI\Container
Customizing of pimple-DIC for ILIAS.
Definition:
Container.php:15
State
Container
MockeryPHPUnitIntegration
ILIAS\BackgroundTasks\Implementation\Bucket\BasicBucket
Definition:
BasicBucket.php:12
PlusJob
BasicBucket
ILIAS\BackgroundTasks\Implementation\Bucket\State\SCHEDULED
const SCHEDULED
Definition:
State.php:11
Injector
BasicPersistence
BasicTaskManager
BackgroundTasks\Implementation\BasicTaskManagerTest\$bucket
$bucket
Definition:
BasicTaskManagerTest.php:27
ILIAS\BackgroundTasks\Implementation\TaskManager\BasicTaskManager
Definition:
BasicTaskManager.php:33
EmptyDependencyMap
DownloadInteger
tests
BackgroundTasks
Implementation
BasicTaskManagerTest.php
Generated on Tue Jan 28 2025 19:01:46 for ILIAS by
1.8.13 (using
Doxyfile
)