1919declare (strict_types=1 );
2020
2121use ILIAS \Cron \Schedule \CronJobScheduleType ;
22+ use ILIAS \Logging \LoggerFactory ;
2223
2324/**
2425 * Class ilCronFinishUnfinishedTestPassesTest
@@ -40,7 +41,15 @@ protected function setUp(): void
4041 define ("ILIAS_LOG_ENABLED " , false );
4142 }
4243
43- $ this ->test_obj = new ilCronFinishUnfinishedTestPasses ();
44+ $ logger_factory = $ this ->getMockBuilder (LoggerFactory::class)
45+ ->disableOriginalConstructor ()
46+ ->getMock ();
47+
48+ $ this ->test_obj = new ilCronFinishUnfinishedTestPasses (
49+ 'components\ILIAS\Test ' ,
50+ $ GLOBALS ['lng ' ],
51+ $ logger_factory
52+ );
4453 }
4554
4655 public function test_instantiateObject_shouldReturnInstance (): void
@@ -63,8 +72,16 @@ public function testGetTitle(): void
6372 ->willReturn ('testString ' )
6473 ;
6574
75+ $ logger_factory = $ this ->getMockBuilder (LoggerFactory::class)
76+ ->disableOriginalConstructor ()
77+ ->getMock ();
78+
6679 $ this ->setGlobalVariable ('lng ' , $ lng_mock );
67- $ test_obj = new ilCronFinishUnfinishedTestPasses ();
80+ $ test_obj = new ilCronFinishUnfinishedTestPasses (
81+ 'components\ILIAS\Test ' ,
82+ $ GLOBALS ['lng ' ],
83+ $ logger_factory
84+ );
6885
6986 $ this ->assertEquals ('testString ' , $ test_obj ->getTitle ());
7087 }
@@ -79,8 +96,16 @@ public function testGetDescription(): void
7996 ->willReturn ('testString ' )
8097 ;
8198
99+ $ logger_factory = $ this ->getMockBuilder (LoggerFactory::class)
100+ ->disableOriginalConstructor ()
101+ ->getMock ();
102+
82103 $ this ->setGlobalVariable ('lng ' , $ lng_mock );
83- $ test_obj = new ilCronFinishUnfinishedTestPasses ();
104+ $ test_obj = new ilCronFinishUnfinishedTestPasses (
105+ 'components\ILIAS\Test ' ,
106+ $ GLOBALS ['lng ' ],
107+ $ logger_factory
108+ );
84109
85110 $ this ->assertEquals ('testString ' , $ test_obj ->getDescription ());
86111 }
0 commit comments