ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
BasicTaskFactoryTest.php
Go to the documentation of this file.
1
<?
php
9
namespace
BackgroundTasks\Implementation\Tasks
;
10
11
use
ILIAS\BackgroundTasks\Implementation\Tasks\BasicTaskFactory
;
12
use
ILIAS\BackgroundTasks\Implementation\Tasks\PlusJob
;
13
use
ILIAS\BackgroundTasks\Implementation\Values\ScalarValues\IntegerValue
;
14
use
ILIAS\DI\Container
;
15
use
ILIAS\BackgroundTasks\Dependencies\DependencyMap\BaseDependencyMap
;
16
use
ILIAS\BackgroundTasks\Dependencies\Injector
;
17
18
class
BasicTaskFactoryTest
extends
\PHPUnit_Framework_TestCase
19
{
20
public
function
testBasicFactory
()
21
{
22
$dic =
new
Container
();
23
$injector =
new
Injector
($dic,
new
BaseDependencyMap
());
24
$taskFactory =
new
BasicTaskFactory
($injector);
25
$plusJob = $taskFactory->createTask(PlusJob::class, [1, 2]);
26
$this->assertTrue($plusJob instanceof
PlusJob
);
27
$plusJobInput = $plusJob->getInput();
28
$one =
new
IntegerValue
();
29
$one->setValue(1);
30
$this->assertTrue($plusJobInput[0]->equals($one));
31
32
$a =
new
IntegerValue
();
33
$a->setValue(1);
34
$b =
new
IntegerValue
();
35
$b->setValue(2);
36
$plusJob = $taskFactory->createTask(PlusJob::class, [$a, $b]);
37
$this->assertTrue($plusJob instanceof PlusJob);
38
$plusJobInput = $plusJob->getInput();
39
$this->assertTrue($plusJobInput[0]->equals($one));
40
}
41
}
ILIAS\BackgroundTasks\Dependencies\Injector
Definition:
Injector.php:19
ILIAS\BackgroundTasks\Dependencies\DependencyMap\BaseDependencyMap
Definition:
BaseDependencyMap.php:17
BackgroundTasks\Implementation\Tasks\BasicTaskFactoryTest\testBasicFactory
testBasicFactory()
Definition:
BasicTaskFactoryTest.php:20
BackgroundTasks\Implementation\Tasks
Created by PhpStorm.
Definition:
BasicTaskFactoryTest.php:9
ILIAS\BackgroundTasks\Implementation\Tasks\BasicTaskFactory
Definition:
BasicTaskFactory.php:12
ILIAS\BackgroundTasks\Implementation\Tasks\PlusJob
Definition:
PlusJob.php:12
PHPUnit_Framework_TestCase
ILIAS\DI\Container
Customizing of pimple-DIC for ILIAS.
Definition:
Container.php:16
Container
IntegerValue
ILIAS\BackgroundTasks\Implementation\Values\ScalarValues\IntegerValue
Definition:
IntegerValue.php:7
PlusJob
Injector
BasicTaskFactory
BaseDependencyMap
php
BackgroundTasks\Implementation\Tasks\BasicTaskFactoryTest
Definition:
BasicTaskFactoryTest.php:18
tests
BackgroundTasks
Implementation
Tasks
BasicTaskFactoryTest.php
Generated on Thu Feb 27 2025 19:02:12 for ILIAS by
1.8.13 (using
Doxyfile
)