not->toBeNull() ->and($output['stdout'])->toBe(str_replace('MARKER', $marker, $argument)) ->and(file_exists($marker))->toBeFalse(); })->with([ 'command substitution' => ['$(touch MARKER)'], 'backticks' => ['`touch MARKER`'], 'sequence' => ['x; touch MARKER'], 'pipe' => ['x | touch MARKER'], 'and list' => ['x && touch MARKER'], 'redirect' => ['x > MARKER'], 'glob and quotes' => ['* "\' \\ ~ $HOME'] ]); test('a program path cannot be smuggled in through the program name', function () { expect(poller_script_exec('/bin/sh', ['-c', 'true']))->toBeNull() ->and(poller_script_exec('sh -c true'))->toBeNull() ->and(poller_script_exec('../../bin/sh'))->toBeNull(); });