ILIAS  release_8 Revision v8.24
ilCronFinishUnfinishedTestPassesTest.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
26{
28
29 protected function setUp(): void
30 {
31 parent::setUp();
32
34 $this->addGlobal_lng();
35 $this->addGlobal_ilDB();
36
37 $this->testObj = new ilCronFinishUnfinishedTestPasses();
38 }
39
41 {
42 $this->assertInstanceOf(ilCronFinishUnfinishedTestPasses::class, $this->testObj);
43 }
44
45 public function testGetId(): void
46 {
47 $this->assertEquals("finish_unfinished_passes", $this->testObj->getId());
48 }
49
50 public function testGetTitle(): void
51 {
52 $lng_mock = $this->createMock(ilLanguage::class);
53 $lng_mock
54 ->expects($this->any())
55 ->method("txt")
56 ->with("finish_unfinished_passes")
57 ->willReturn("testString");
58
59 $this->setGlobalVariable("lng", $lng_mock);
60
61 $this->assertEquals("testString", $this->testObj->getTitle());
62 }
63
64 public function testGetDescription(): void
65 {
66 $lng_mock = $this->createMock(ilLanguage::class);
67 $lng_mock
68 ->expects($this->any())
69 ->method("txt")
70 ->with("finish_unfinished_passes_desc")
71 ->willReturn("testString");
72
73 $this->setGlobalVariable("lng", $lng_mock);
74
75 $this->assertEquals("testString", $this->testObj->getDescription());
76 }
77
78 public function testGetDefaultScheduleType(): void
79 {
80 $this->assertEquals(
82 $this->testObj->getDefaultScheduleType()
83 );
84 }
85
86 public function testHasAutoActivation(): void
87 {
88 $this->assertFalse($this->testObj->hasAutoActivation());
89 }
90
91 public function testHasFlexibleSchedule(): void
92 {
93 $this->assertTrue($this->testObj->hasFlexibleSchedule());
94 }
95
96 public function testHasCustomSettings(): void
97 {
98 $this->assertTrue($this->testObj->hasCustomSettings());
99 }
100
101 public function testRun(): void
102 {
103 $this->assertInstanceOf(ilCronJobResult::class, $this->testObj->run());
104 }
105}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const SCHEDULE_TYPE_DAILY
@depracated This will be replaced with an ENUM in ILIAS 9
Class ilTestBaseClass.
setGlobalVariable(string $name, $value)