xref: /ext-ds/test.php (revision c475c511)
1<?php
2
3require __DIR__ . '/vendor/autoload.php';
4
5// Check that the extension is loaded.
6if ( ! extension_loaded('ds')) {
7    echo "ds extension is not enabled\n";
8    exit(1);
9}
10
11// Check that opcache is enabled correctly.
12if (getenv('ENABLE_OPCACHE')) {
13    if (!function_exists('opcache_get_status') || ! opcache_get_status(false)['opcache_enabled']) {
14        echo "opcache is not enabled\n";
15        exit(1);
16    }
17}
18
19// So that PHPUnit doesn't use "exit"
20$status = \PHPUnit\TextUI\Command::main(false);
21
22// Attempt to collect anything left over from the tests.
23gc_collect_cycles();
24
25exit($status);
26