ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
BasicTaskFactoryTest.php
Go to the documentation of this file.
1<?php
10
17use PHPUnit\Framework\TestCase;
18
19class 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}
An exception for terminatinating execution or to throw for unit testing.
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:18
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
$dic
Definition: result.php:13