toBeString()->not->toBeEmpty(); } }); test('PHP 8 makes both division and modulo by zero fatal', function () { expect(fn () => 5 % 0)->toThrow(DivisionByZeroError::class) ->and(fn () => 5 / 0)->toThrow(DivisionByZeroError::class); }); test('the aggregate colour round robin checks the template has colours', function () use ($base) { $src = file_get_contents($base . '/lib/api_aggregate.php'); // the id is bound now, as the count above it already was expect($src)->not->toContain("WHERE color_template_id=' . \$_color_templates[\$i] . '") ->and($src)->toContain('WHERE color_template_id = ?'); $guard = strpos($src, 'if ($num_colors > 0) {'); $use = strpos($src, '$offset = $_selected_graph_index % $num_colors;'); expect($guard)->not->toBeFalse() ->and($use)->not->toBeFalse() ->and($guard)->toBeLessThan($use); }); test('the connection recommendation checks max_connections came back', function () use ($base) { $src = file_get_contents($base . '/lib/utility.php'); expect($src)->not->toContain('$recommendation = $remainingMem / $maxConnections;') ->and($src)->toContain('$maxConnections > 0 ? $remainingMem / $maxConnections : 0'); });