ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
◀ 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
use
PHPUnit\Framework\TestCase
;
18
19
class
BasicTaskFactoryTest
extends
TestCase
20
{
21
public
function
testBasicFactory
()
22
{
23
$dic
=
new
Container
();
24
$injector =
new
Injector
(
$dic
,
new
BaseDependencyMap
());
25
$taskFactory =
new
BasicTaskFactory
($injector);
26
$plusJob = $taskFactory->createTask(PlusJob::class, [1, 2]);
27
$this->assertTrue($plusJob instanceof
PlusJob
);
28
$plusJobInput = $plusJob->getInput();
29
$one =
new
IntegerValue
();
30
$one->setValue(1);
31
$this->assertTrue($plusJobInput[0]->equals($one));
32
33
$a
=
new
IntegerValue
();
34
$a
->setValue(1);
35
$b
=
new
IntegerValue
();
36
$b
->setValue(2);
37
$plusJob = $taskFactory->createTask(PlusJob::class, [
$a
,
$b
]);
38
$this->assertTrue($plusJob instanceof PlusJob);
39
$plusJobInput = $plusJob->getInput();
40
$this->assertTrue($plusJobInput[0]->equals($one));
41
}
42
}
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:21
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
ILIAS\DI\Container
Customizing of pimple-DIC for ILIAS.
Definition:
Container.php:17
Container
IntegerValue
ILIAS\BackgroundTasks\Implementation\Values\ScalarValues\IntegerValue
Definition:
IntegerValue.php:7
PlusJob
Injector
BasicTaskFactory
Vendor\Package\$b
$b
Definition:
example_cleaned.php:31
BaseDependencyMap
Vendor\Package\$a
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
Definition:
example_cleaned.php:31
$dic
$dic
Definition:
result.php:13
BackgroundTasks\Implementation\Tasks\BasicTaskFactoryTest
Definition:
BasicTaskFactoryTest.php:19
TestCase
tests
BackgroundTasks
Implementation
Tasks
BasicTaskFactoryTest.php
Generated on Sun Aug 31 2025 20:01:32 for ILIAS by
1.8.13 (using
Doxyfile
)