Skip to content

Commit d8f5702

Browse files
test: isolate poller scheduling Cacti time stub
1 parent f295a73 commit d8f5702

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tests/Unit/PollerSchedulingTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,17 @@ protected function setUp(): void {
3434
parent::setUp();
3535

3636
$GLOBALS['config']['poller_id'] = 1;
37+
$GLOBALS['config']['base_path'] = sys_get_temp_dir() . '/thold-poller-scheduling';
38+
39+
$plugins = $GLOBALS['config']['base_path'] . '/plugins';
40+
41+
if (!is_dir($plugins)) {
42+
mkdir($plugins, 0777, true);
43+
}
44+
45+
if (!file_exists($plugins . '/thold')) {
46+
symlink(dirname(__DIR__, 2), $plugins . '/thold');
47+
}
3748

3849
/*
3950
* includes/polling.php includes Cacti's lib/time.php at call time.

0 commit comments

Comments
 (0)