ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilCronFinishUnfinishedTestPassesTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
23
29{
31
32 protected function setUp(): void
33 {
34 parent::setUp();
35
37 $this->addGlobal_ilUser();
38 $this->addGlobal_lng();
39 $this->addGlobal_ilDB();
40 if (!defined("ILIAS_LOG_ENABLED")) {
41 define("ILIAS_LOG_ENABLED", false);
42 }
43
44 $this->test_obj = new ilCronFinishUnfinishedTestPasses();
45 }
46
48 {
49 $this->assertInstanceOf(ilCronFinishUnfinishedTestPasses::class, $this->test_obj);
50 }
51
52 public function testGetId(): void
53 {
54 $this->assertEquals('finish_unfinished_passes', $this->test_obj->getId());
55 }
56
57 public function testGetTitle(): void
58 {
59 $lng_mock = $this->createMock(ilLanguage::class);
60 $lng_mock
61 ->expects($this->any())
62 ->method('txt')
63 ->with('finish_unfinished_passes')
64 ->willReturn('testString')
65 ;
66
67 $this->setGlobalVariable('lng', $lng_mock);
69
70 $this->assertEquals('testString', $test_obj->getTitle());
71 }
72
73 public function testGetDescription(): void
74 {
75 $lng_mock = $this->createMock(ilLanguage::class);
76 $lng_mock
77 ->expects($this->any())
78 ->method('txt')
79 ->with('finish_unfinished_passes_desc')
80 ->willReturn('testString')
81 ;
82
83 $this->setGlobalVariable('lng', $lng_mock);
85
86 $this->assertEquals('testString', $test_obj->getDescription());
87 }
88
89 public function testGetDefaultScheduleType(): void
90 {
91 $this->assertEquals(JobScheduleType::DAILY, $this->test_obj->getDefaultScheduleType());
92 }
93
94 public function testHasAutoActivation(): void
95 {
96 $this->assertFalse($this->test_obj->hasAutoActivation());
97 }
98
99 public function testHasFlexibleSchedule(): void
100 {
101 $this->assertTrue($this->test_obj->hasFlexibleSchedule());
102 }
103
104 public function testHasCustomSettings(): void
105 {
106 $this->assertTrue($this->test_obj->hasCustomSettings());
107 }
108
109 public function testRun(): void
110 {
111 $this->markTestSkipped('Failed for some unknown reason.');
112 $this->assertInstanceOf(JobResult::class, $this->test_obj->run());
113 }
114}
Class ilCronFinishUnfinishedTestPassesTest.
Class ilTestBaseClass.
setGlobalVariable(string $name, mixed $value)
addGlobal_ilObjDataCache()