ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
BasicTaskFactoryTest.php
Go to the documentation of this file.
1 <?php
10 
17 
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 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:16