ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
BasicTaskFactoryTest.php
Go to the documentation of this file.
1 <?php
2 
27 
35 
36 class BasicTaskFactoryTest extends TestCase
37 {
38  public function testBasicFactory(): void
39  {
40  $dic = new Container();
41  $injector = new Injector($dic, new BaseDependencyMap());
42  $taskFactory = new BasicTaskFactory($injector);
43  $plusJob = $taskFactory->createTask(PlusJob::class, [1, 2]);
44  $this->assertInstanceOf(\ILIAS\BackgroundTasks\Implementation\Tasks\PlusJob::class, $plusJob);
45  $plusJobInput = $plusJob->getInput();
46  $one = new IntegerValue();
47  $one->setValue(1);
48  $this->assertTrue($plusJobInput[0]->equals($one));
49 
50  $a = new IntegerValue();
51  $a->setValue(1);
52  $b = new IntegerValue();
53  $b->setValue(2);
54  $plusJob = $taskFactory->createTask(PlusJob::class, [$a, $b]);
55  $this->assertInstanceOf(\ILIAS\BackgroundTasks\Implementation\Tasks\PlusJob::class, $plusJob);
56  $plusJobInput = $plusJob->getInput();
57  $this->assertTrue($plusJobInput[0]->equals($one));
58  }
59 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface Observer Contains several chained tasks and infos about them.
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
$dic
Definition: result.php:31