Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

zanematthew's avatar

I've also tried doing the same with Sqlite, using the below command, however its failing with PDO driver not found.

php -n -d extension=pdo_sqlite.so vendor/bin/phpunit

I haven't had a chance to look into this, my guess is that something isn't configured in config/database.php settings.

The image I'm using is a custom image fromphp:7.2.9-fpm-alpine3.8, below is the Dockerfile.

FROM php:7.2.9-fpm-alpine3.8

RUN apk add --no-cache \
  $PHPIZE_DEPS \
  openssh \
  zlib-dev \
  && docker-php-ext-install pdo pdo_mysql \
  && pecl install redis && docker-php-ext-enable redis \
  && pecl install xdebug-2.6.0 && docker-php-ext-enable xdebug \
  && { \
    echo 'xdebug.remote_autostart=1'; \
    echo 'xdebug.remote_enable=1'; \
    echo 'xdebug.remote_host=host.docker.internal'; \
    echo 'xdebug.remote_port=9000'; \
    echo 'xdebug.idekey=PHPSTORM'; \
  } >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
  && php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
  && php composer-setup.php \
    --version=1.7.2 \
    --install-dir=/usr/bin --filename=composer \
  && php -r "unlink('composer-setup.php');"
pettturu's avatar

Just a note... had kind of a problem of same kind.

Suddenly all my tests became very slow to run. Then I noticed I've got a sql query in one of my Jobs constructor. (I was planning to fetch some default data if one not provided in the constructor call).

Well, moved the query to the job's handle method and everything went back to normal... never came to mind that the Jobs would be constructed for every test...

jesseschutt's avatar

Just checking in here to see if anyone has any new information on this thread - I have a similar situation but interestingly enough the tests run fine on my laptop but hit a slow spot on my iMac.

EDIT - Well I found out what was going on at least in my situation. I had the session_driver set to file and there were like 35k session files in the storage directory! Clearing them and/or switching to array has my tests running snappy again!

Previous

Please or to participate in this conversation.