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();
35 $b =
new IntegerValue();
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 }
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples