21 require_once(
"libs/composer/vendor/autoload.php");
35 public function testPlusTask()
49 $t1 =
$factory->createInstance(PlusJob::class);
50 $t1->setInput([$a, $b]);
53 $t2 =
$factory->createInstance(PlusJob::class);
54 $t2->setInput([$t1, $c]);
56 $this->assertTrue($t2->getOutputType()->equals(
new SingleType(IntegerValue::class)));
60 $finalValue = $taskManager->executeTask($t2,
new MockObserver());
61 $this->assertEquals($finalValue->getValue(), 6);
64 public function testValueWrapper()
67 $dic[Bucket::class] =
function ($c) {
68 return new BucketMock();
78 $this->assertEquals($finalValue->getValue(), 5);
81 public function testTypeCheck()
83 $this->expectException(InvalidArgumentException::class);
86 $dic[Bucket::class] =
function ($c) {
87 return new BucketMock();
95 $t1 =
$factory->createInstance(PlusJob::class);
96 $t1->setInput([$a, $b]);
99 public function testAggregation()
105 $list->setValue([1,
"hello", 3.0]);
108 $t1 =
$factory->createInstance(ConcatenationJob::class);
109 $t1->setInput([
$list]);
112 $this->assertEquals(
$output->getValue(),
"1, hello, 3");
115 public function testUnfoldTask()
118 $dic[Bucket::class] =
function ($c) {
127 $t0 =
$factory->createInstance(PlusJob::class);
128 $t0->setInput([1, 1]);
131 $t1 =
$factory->createInstance(PlusJob::class);
132 $t1->setInput([$t0, 2]);
135 $t25 =
$factory->createInstance(PlusJob::class);
136 $t25->setInput([2, 2]);
139 $t2 =
$factory->createInstance(PlusJob::class);
140 $t2->setInput([$t1, $t25]);
142 $this->assertTrue($t2->getOutputType()->equals(
new SingleType(IntegerValue::class)));
144 $list = $t2->unfoldTask();
145 $this->assertEquals($list, [$t2, $t1, $t0, $t25]);
150 $finalValue = $taskManager->executeTask($t2,
new MockObserver());
151 $this->assertEquals($finalValue->getValue(), 8);
if(isset($_REQUEST['delete'])) $list
Customizing of pimple-DIC for ILIAS.
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
Class BackgroundTaskTest.