ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ 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\TaskManager\SyncTaskManager
;
16
use
ILIAS\BackgroundTasks\Implementation\Tasks\DownloadInteger
;
17
use
ILIAS\BackgroundTasks\Implementation\Tasks\PlusJob
;
18
use
ILIAS\DI\Container
;
19
use
ILIAS\BackgroundTasks\Dependencies\DependencyMap\EmptyDependencyMap
;
20
use
ILIAS\BackgroundTasks\Dependencies\Injector
;
21
use
Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration
;
22
23
class
BasicTaskManagerTest
extends
\PHPUnit_Framework_TestCase
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
}
ILIAS\BackgroundTasks\Dependencies\Injector
Definition:
Injector.php:19
BackgroundTasks\Implementation\BasicTaskManagerTest
Definition:
BasicTaskManagerTest.php:23
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:27
$factory
$factory
Definition:
metadata.php:43
BackgroundTasks\Implementation\BasicTaskManagerTest\setUp
setUp()
Definition:
BasicTaskManagerTest.php:30
$c
$c
Definition:
inc.setup_header.php:183
PHPUnit_Framework_TestCase
MockeryPHPUnitIntegration
ILIAS\DI\Container
Customizing of pimple-DIC for ILIAS.
Definition:
Container.php:16
State
SyncTaskManager
Container
ILIAS\BackgroundTasks\Implementation\TaskManager\SyncTaskManager
Definition:
SyncTaskManager.php:27
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:28
php
EmptyDependencyMap
DownloadInteger
tests
BackgroundTasks
Implementation
BasicTaskManagerTest.php
Generated on Thu Jan 16 2025 19:02:38 for ILIAS by
1.8.13 (using
Doxyfile
)