Files
TheWitnessandCopilot bef1ad80a0 Fix alert audio not rendering: resolve sounds dir from plugin root (#278)
getMonitorSound() used __DIR__ . '/sounds/' after the controller moved to includes/, so the sound file was never found and the audio element was never printed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-16 15:20:41 -04:00

20 lines
854 B
PHP

<?php
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
+-------------------------------------------------------------------------+
| Cacti: The Complete RRDTool-based Graphing Solution |
+-------------------------------------------------------------------------+
*/
it('resolves the alert sound against the plugin sounds directory', function () {
$root = dirname(__DIR__, 2);
$contents = file_get_contents($root . '/includes/controller.php');
expect($contents)->not->toBeFalse();
expect($contents)->toContain("dirname(__DIR__) . '/sounds/'");
expect($contents)->not->toContain("__DIR__ . '/sounds/'");
expect(is_dir($root . '/sounds'))->toBeTrue();
expect(is_dir($root . '/includes/sounds'))->toBeFalse();
});