# wp-optimize/3.2.5/vendor/rosell-dk/exec-with-fallback/tests/ShellExecTest.php

WP-Optimize – Cache, Compress images, Minify &amp; Clean database to boost page speed &amp; performance, version 3.2.5. 39 lines.

- Page: https://pluginprobe.com/plugins/wp-optimize/3.2.5/code/vendor/rosell-dk/exec-with-fallback/tests/ShellExecTest.php
- Raw: https://pluginprobe.com/plugins/wp-optimize/3.2.5/raw/vendor/rosell-dk/exec-with-fallback/tests/ShellExecTest.php
- Modified: 2022-06-03T18:20:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-optimize/3.2.5/code/vendor/rosell-dk/exec-with-fallback/tests/ShellExecTest.php#L10-L20`.

```php
<?php
namespace ExecWithFallback\Tests;

use PHPUnit\Framework\TestCase;

use ExecWithFallback\ShellExec;

class ShellExecTest extends BaseTest
{

    public $className = 'ShellExec';
    public $supportsResultCode = false;

    public function isAvailable()
    {
        return function_exists('shell_exec');
    }

    public function runExec($command, &$output = null, &$result_code = null)
    {
        if (func_num_args() == 3) {
            return ShellExec::exec($command, $output, $result_code);
        } else {
            return ShellExec::exec($command, $output);
        }
    }

/*
    public function testCodeSupplied()
    {
        if ($this->checkAvailability()) {
            $output = [];
            $execResult = $this->runExec('echo hi', $output, $return_code);
            $this->assertFalse($execResult);
        }
    }*/

}

```
