ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilCronFinishUnfinishedTestPassesTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
28 {
30 
31  protected function setUp(): void
32  {
33  parent::setUp();
34 
35  $this->addGlobal_ilObjDataCache();
36  $this->addGlobal_ilUser();
37  $this->addGlobal_lng();
38  $this->addGlobal_ilDB();
39 
40  $this->test_obj = new ilCronFinishUnfinishedTestPasses();
41  }
42 
44  {
45  $this->assertInstanceOf(ilCronFinishUnfinishedTestPasses::class, $this->test_obj);
46  }
47 
48  public function testGetId(): void
49  {
50  $this->assertEquals("finish_unfinished_passes", $this->test_obj->getId());
51  }
52 
53  public function testGetTitle(): void
54  {
55  $lng_mock = $this->createMock(ilLanguage::class);
56  $lng_mock
57  ->expects($this->any())
58  ->method("txt")
59  ->with("finish_unfinished_passes")
60  ->willReturn("testString");
61 
62  $this->setGlobalVariable("lng", $lng_mock);
63  $test_obj = new ilCronFinishUnfinishedTestPasses();
64 
65  $this->assertEquals("testString", $test_obj->getTitle());
66  }
67 
68  public function testGetDescription(): void
69  {
70  $lng_mock = $this->createMock(ilLanguage::class);
71  $lng_mock
72  ->expects($this->any())
73  ->method("txt")
74  ->with("finish_unfinished_passes_desc")
75  ->willReturn("testString");
76 
77  $this->setGlobalVariable("lng", $lng_mock);
78  $test_obj = new ilCronFinishUnfinishedTestPasses();
79 
80  $this->assertEquals("testString", $test_obj->getDescription());
81  }
82 
83  public function testGetDefaultScheduleType(): void
84  {
85  $this->assertEquals(
86  CronJobScheduleType::SCHEDULE_TYPE_DAILY,
87  $this->test_obj->getDefaultScheduleType()
88  );
89  }
90 
91  public function testHasAutoActivation(): void
92  {
93  $this->assertFalse($this->test_obj->hasAutoActivation());
94  }
95 
96  public function testHasFlexibleSchedule(): void
97  {
98  $this->assertTrue($this->test_obj->hasFlexibleSchedule());
99  }
100 
101  public function testHasCustomSettings(): void
102  {
103  $this->assertTrue($this->test_obj->hasCustomSettings());
104  }
105 
106  public function testRun(): void
107  {
108  $this->assertInstanceOf(ilCronJobResult::class, $this->test_obj->run());
109  }
110 }
Class ilCronFinishUnfinishedTestPassesTest.
Class ilCronFinishUnfinishedTestPasses.
setGlobalVariable(string $name, $value)
Class ilTestBaseClass.