mirror of
https://github.com/Cacti/cacti.git
synced 2026-10-30 00:26:50 +09:00
* fix(tests): correct path depths after the domain reorganisation The category move left nine files resolving paths relative to their old depth, so the bootstrap could not read tests/Helpers/UnitStubs.php and no test ran at all. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix tests without replacing production functions * remove unrelated failing integration tests * remove unrelated broken test workflows --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
29 lines
1.2 KiB
PHP
29 lines
1.2 KiB
PHP
<?php
|
|
/*
|
|
+-------------------------------------------------------------------------+
|
|
| Copyright (C) 2004-2026 The Cacti Group |
|
|
| |
|
|
| This program is free software; you can redistribute it and/or |
|
|
| modify it under the terms of the GNU General Public License |
|
|
| as published by the Free Software Foundation; either version 2 |
|
|
| of the License, or (at your option) any later version. |
|
|
+-------------------------------------------------------------------------+
|
|
| Cacti: The Complete RRDtool-based Graphing Solution |
|
|
+-------------------------------------------------------------------------+
|
|
*/
|
|
|
|
require_once dirname(__DIR__, 2) . '/Helpers/UnitStubs.php';
|
|
|
|
it('cacti_sizeof handles various inputs', function () {
|
|
expect(cacti_sizeof([1, 2, 3]))->toBe(3);
|
|
expect(cacti_sizeof([]))->toBe(0);
|
|
expect(cacti_sizeof(false))->toBe(0);
|
|
expect(cacti_sizeof(null))->toBe(0);
|
|
expect(cacti_sizeof('not an array'))->toBe(0);
|
|
});
|
|
|
|
it('cacti_count handles various inputs', function () {
|
|
expect(cacti_count([1, 2]))->toBe(2);
|
|
expect(cacti_count(false))->toBe(0);
|
|
});
|