skip to Main Content

Xdebug runs out of memory with PHPUnit – Docker

Maybe memory overflow isn't the correct description of what happening, but the point is: PHPUnit eat all of the memory and then dies the container. Here is my phpunit.dockerfile: FROM php:8.1-fpm-alpine WORKDIR /var/www/html RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ --allow-untrusted…

VIEW QUESTION

How to add xdebug to php:8.1-fpm-alpine Docker container?

I have this dockerfile for my phpunit container: FROM php:8.1-fpm-alpine WORKDIR /var/www/html RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ --allow-untrusted gnu-libiconv ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php ENV PHP_MEMORY_LIMIT=1G ENV PHP_UPLOAD_MAX_FILESIZE: 512M ENV PHP_POST_MAX_SIZE: 512M RUN docker-php-ext-install pdo RUN apk add --no-cache libpng…

VIEW QUESTION

PHPUnit mocking WordPress function calls

I am building a simple WordPress plugin and I am looking to add unit tests using PHPUnit, I have the following class code: <?php namespace App; class MyPlugin { public function __construct() { add_action('admin_enqueue_scripts', [$this, 'enqueueAdminScripts']); add_action('admin_menu', [$this, 'createAdminMenu']); add_action('admin_init',…

VIEW QUESTION

Redis – DDEV/Laravel/PHPUnit: Problems with setup in PhpStorm

Using Laravel with DDEV/Docker on a Mac, I am stuck getting PhpStorm to run directly PHPUnit with coverage. I am following these instructions: https://ddev.readthedocs.io/en/stable/users/topics/phpstorm/ I started the setup with curl -s "https://laravel.build/myproject?with=mysql,redis,memcached" | bash Everything's is working fine, including debugging…

VIEW QUESTION

PHPUnit Cannot acquire reference to $GLOBALS – PHP Versions

I am getting an error when running PHPUnit tests on GitHub actions. PHP Fatal error: Cannot acquire reference to $GLOBALS in /home/runner/work/project-name/project-name/vendor/phpunit/phpunit/src/Util/Configuration.php on line 570 It seems like this error is likely related to PHP8 (https://php.watch/versions/8.1/GLOBALS-restrictions), but the test matrix…

VIEW QUESTION
Back To Top
Search