ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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  if (!defined("ILIAS_LOG_ENABLED")) {
40  define("ILIAS_LOG_ENABLED", false);
41  }
42 
43  $this->test_obj = new ilCronFinishUnfinishedTestPasses();
44  }
45 
47  {
48  $this->assertInstanceOf(ilCronFinishUnfinishedTestPasses::class, $this->test_obj);
49  }
50 
51  public function testGetId(): void
52  {
53  $this->assertEquals('finish_unfinished_passes', $this->test_obj->getId());
54  }
55 
56  public function testGetTitle(): void
57  {
58  $lng_mock = $this->createMock(ilLanguage::class);
59  $lng_mock
60  ->expects($this->any())
61  ->method('txt')
62  ->with('finish_unfinished_passes')
63  ->willReturn('testString')
64  ;
65 
66  $this->setGlobalVariable('lng', $lng_mock);
67  $test_obj = new ilCronFinishUnfinishedTestPasses();
68 
69  $this->assertEquals('testString', $test_obj->getTitle());
70  }
71 
72  public function testGetDescription(): void
73  {
74  $lng_mock = $this->createMock(ilLanguage::class);
75  $lng_mock
76  ->expects($this->any())
77  ->method('txt')
78  ->with('finish_unfinished_passes_desc')
79  ->willReturn('testString')
80  ;
81 
82  $this->setGlobalVariable('lng', $lng_mock);
83  $test_obj = new ilCronFinishUnfinishedTestPasses();
84 
85  $this->assertEquals('testString', $test_obj->getDescription());
86  }
87 
88  public function testGetDefaultScheduleType(): void
89  {
90  $this->assertEquals(CronJobScheduleType::SCHEDULE_TYPE_DAILY, $this->test_obj->getDefaultScheduleType());
91  }
92 
93  public function testHasAutoActivation(): void
94  {
95  $this->assertFalse($this->test_obj->hasAutoActivation());
96  }
97 
98  public function testHasFlexibleSchedule(): void
99  {
100  $this->assertTrue($this->test_obj->hasFlexibleSchedule());
101  }
102 
103  public function testHasCustomSettings(): void
104  {
105  $this->assertTrue($this->test_obj->hasCustomSettings());
106  }
107 
108  public function testRun(): void
109  {
110  $this->markTestSkipped('Failed for some unknown reason.');
111  $this->assertInstanceOf(ilCronJobResult::class, $this->test_obj->run());
112  }
113 }
Class ilCronFinishUnfinishedTestPassesTest.
Class ilCronFinishUnfinishedTestPasses.