-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathartisan
More file actions
28 lines (22 loc) · 733 Bytes
/
Copy pathartisan
File metadata and controls
28 lines (22 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env php
<?php
// Set cache driver to array to avoid database connection
putenv('CACHE_STORE=array');
$_ENV['CACHE_STORE'] = 'array';
// Get the path to Testbench
$testbenchPath = __DIR__ . '/vendor/bin/testbench';
// Check if Testbench exists
if (!file_exists($testbenchPath)) {
fwrite(STDERR, "Error: vendor/bin/testbench not found. Run 'composer install' first.\n");
exit(1);
}
// Get all command line arguments (skip script name)
$args = array_slice($argv, 1);
// Build the command
$command = escapeshellarg($testbenchPath);
if (!empty($args)) {
$command .= ' ' . implode(' ', array_map('escapeshellarg', $args));
}
// Execute and pass through exit code
passthru($command, $exitCode);
exit($exitCode);