I am upgrading my Laravel app form L6 to L7 and when I try to run integration tests, it ends in failure. So here is my setup code:
protected function runCommand($command, array $arguments = [], OutputInterface $output = null)
{
$process = new Process([$command]);
$process->setTimeout(120);
$process->run();
if ($process->isSuccessful()) {
\Log::debug('successfully');
} else {
\Log::debug('NOT', [$process->getIncrementalErrorOutput()]);
}
}
Now as you can see, this method is running some commands and when the commnds run, these are the errors I get:
[2023-12-05 07:17:31] testing.DEBUG: NOT ["sh: 1: exec: mysql -hdb -uroot -psecret -e \"drop schema if exists phirater_tst; create schema phirater_tst default charset utf8 collate utf8_unicode_ci\": not found\n"]
[2023-12-05 07:17:31] testing.DEBUG: NOT ["sh: 1: exec: ./artisan migrate --database=mysql_testing: not found\n"]
[2023-12-05 07:17:31] testing.DEBUG: NOT ["sh: 1: exec: mysqldump -hdb -uroot -ppass --add-drop-table phirater_tst > /tmp/e1440949b437f065addb21be548316b4: not found\n"]
[2023-12-05 07:17:31] testing.DEBUG: NOT ["sh: 1: exec: mysql -hdb -uroot -ppass phirater_tst < /tmp/e1440949b437f065addb21be548316b4: not found\n"]
I am on PHP 7.4 with L7 running in a docker container. What am I doing wrong here?
EDIT:
If I run these commands directly inside the container, these work fine.