ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilCommonSetupAgentTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Tests\Setup;
22
23use PHPUnit\Framework\TestCase;
28use ILIAS\Refinery\Factory as Refinery;
29use ILIAS\Data\Factory as DataFactory;
30use ilLanguage;
31
37class ilCommonSetupAgentTest extends TestCase
38{
40
41 protected function setUp(): void
42 {
43 $refinery = new Refinery(
44 $this->createStub(DataFactory::class),
45 $this->createStub(ilLanguage::class)
46 );
47
49 $this->testObj = new ilCommonSetupAgent($refinery, $this->createStub(DataFactory::class));
50 }
51
52 public function testGetNamedObjectives(): void
53 {
54 $this->assertArrayHasKey(
55 "registerNICKey",
56 $this->testObj->getNamedObjectives(new NullConfig())
57 );
58 }
59
60 public function testExecuteClosure(): void
61 {
62 $objectiveConstructor = $this->testObj->getNamedObjectives(new NullConfig())["registerNICKey"];
63 $closureResult = $objectiveConstructor->create();
64 $this->assertInstanceOf(Objective::class, $closureResult);
65 }
66}
Builds data types.
Definition: Factory.php:36
A configuration with no content.
Definition: NullConfig.php:27
A objective collection is a objective that is achieved once all subobjectives are achieved.
Contains common objectives for the setup.
language handling