From 6df03063c8ef3d248c12a0bbdd9cf09f758267c4 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 5 Jan 2024 12:34:59 +0000 Subject: [PATCH] remove test --- .../Grav/Common/Scheduler/SchedulerTest.php | 79 ------------------- 1 file changed, 79 deletions(-) delete mode 100644 tests/unit/Grav/Common/Scheduler/SchedulerTest.php diff --git a/tests/unit/Grav/Common/Scheduler/SchedulerTest.php b/tests/unit/Grav/Common/Scheduler/SchedulerTest.php deleted file mode 100644 index b16ece8b6b..0000000000 --- a/tests/unit/Grav/Common/Scheduler/SchedulerTest.php +++ /dev/null @@ -1,79 +0,0 @@ - ['args'=>[], 'command'=>'ls', 'at'=>'0 * * * *'], - ], - [ - 'aze45aze' => ['last-run' => strtotime('2021-01-01 00:00:00')], - ] - ], - [ - new \DateTime('+2 hours'), - [ - 'aze45aze' => ['args'=>[], 'command'=>'ls', 'at'=>'0 * * * *'], - 'zedz5a4eza' => ['args'=>[], 'command'=>'ls', 'at'=>'*/15 * * * *'], - ], - [ - 'aze45aze' => ['last-run' => strtotime('-5 minutes')], - ] - ], - ]; - } - - protected function _before() - { - $this->grav = Fixtures::get('grav')(); - $this->scheduler = new Scheduler(); - $this->statusFilePath = Grav::instance()['locator']->findResource('user-data://scheduler', true, true).'/status.yaml'; - } - - protected function _after() - { - if (file_exists($this->statusFilePath)) { - unlink($this->statusFilePath); - } - } - - /** - * @dataProvider dataProviderForTestIsOverdue - */ - public function testIsOverdue($date, $jobs, $status){ - $file = $this->scheduler->getJobStates(); - $file->save($status); - $this->grav['config']->set('scheduler.custom_jobs', $jobs); - $this->scheduler->run($date, false, true); - $this->assertFileExists($this->statusFilePath); - $this->assertFileIsReadable($this->statusFilePath); - foreach ($jobs as $id => $job) { - $this->assertStringContainsString($id, file_get_contents($this->statusFilePath)); - } - } -}