ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ 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
}
BackgroundTasks\Implementation\Tasks\BasicTaskFactoryTest
Definition:
BasicTaskFactoryTest.php:19
BackgroundTasks\Implementation\Tasks\BasicTaskFactoryTest\testBasicFactory
testBasicFactory()
Definition:
BasicTaskFactoryTest.php:20
php
An exception for terminatinating execution or to throw for unit testing.
ILIAS\BackgroundTasks\Dependencies\DependencyMap\BaseDependencyMap
Definition:
BaseDependencyMap.php:18
ILIAS\BackgroundTasks\Dependencies\Injector
Definition:
Injector.php:20
ILIAS\BackgroundTasks\Implementation\Tasks\BasicTaskFactory
Definition:
BasicTaskFactory.php:14
ILIAS\BackgroundTasks\Implementation\Tasks\PlusJob
Definition:
PlusJob.php:14
ILIAS\BackgroundTasks\Implementation\Values\ScalarValues\IntegerValue
Definition:
IntegerValue.php:8
ILIAS\DI\Container
Customizing of pimple-DIC for ILIAS.
Definition:
Container.php:16
PHPUnit_Framework_TestCase
BackgroundTasks\Implementation\Tasks
Created by PhpStorm.
Definition:
BasicTaskFactoryTest.php:9
tests
BackgroundTasks
Implementation
Tasks
BasicTaskFactoryTest.php
Generated on Sat Oct 4 2025 19:01:27 for ILIAS by
1.9.4 (using
Doxyfile
)