Join us for the Moodle Academy webinar “What’s New in Moodle 4.3” on Thursday 19th October at 11:00 UTC
We invite you to register to join us for the free Moodle Academy webinar “What’s New in Moodle 4.3” on Thursday 19th October, at 11:00-12:00 UTC.
In this webinar you will learn about the new features of Moodle 4.3 for administrators and teachers.
This webinar is part of the course ‘What’s New in Moodle 4.3′. You have to be enrolled in the course to join the webinar.
DrupalEasy: Debugging all the things with Xdebug, DDEV, PhpStorm, PhpUnit
Over the past few years, we’ve published a couple of blog posts about setting up Xdebug for Drupal module development. But, like all things in tech, there’s always more to learn as tools and technology evolve.
The setup
I was recently working with one of our Professional (Drupal) Module Development students trying to determine why she wasn’t able to use Xdebug to debug a PhpUnit-based functional test. To be clear, the breakpoint wasn’t set in the actual test class, the breakpoint was set in some custom module code that was called by the test class.
In functional tests, Guzzle is used by PhpUnit to make calls like:
$this->drupalGet('')
So, in a way, there isn’t a direct PHP connection between test class and the code under test. It is in this circumstance that the breakpoint wasn’t working.
Xdebug was working fine for this student to debug other aspects of the same project – it just wasn’t hitting breakpoints during functional tests.
The solution
This was one of those instances that I had seen (and solved) previously, but to be honest, PhpStorm/Xdebug solutions have often involved numerous trips into the (extensive) PhpStorm settings area. By the time the problem is fixed, I was never 100% sure exactly which change I made had actually solved the problem. But, this time, I was more careful…
Obviously, Xdebug must be enabled in DDEV, and PhpStorm’s almost-magical auto-configuration for Xdebug needs to have configured a new “Server” with proper path mappings (especially for the project root).
The PhpStorm configuration settings related to Xdebug that I now recommend are:
- Set the “Max connections” value to 20 in the “PHP | Debug” configuration area (see image above).
- Uncheck the “Force break at the first line when no path mapping is specified,” “Force break at first line when a script is outside the project” and “Ignore external connections through unregistered server configurations” checkboxes in the “PHP | Debug” configuration area (see image above.)
- Set “Host” and “Name” in the “PHP | Servers” configuration are the same (and of the form name.ddev.site, where name is your site’s DDEV machine name) (see image below.)
- When running functional tests, PhpStorm may request to see up a new server connection in “PHP | Servers” with the name “localhost.” Allow it and ensure the path mapping is correct.
With these settings, functional PhpUnit tests can be effectively debugged.
Benry-CmdOpt (command option parser) 2.0 released
Benry-CmdOpt is a command option parser library, much better than
optparse.rb
.Release 2.0 has not only a lot of improvements but also breaking changes.
See document and CHANGES for details.
FSF News: LibrePlanet 2024: “Cultivating Community” will feature a keynote by David Wilson
Software Foundation (FSF) today announced free software
developer and video creator David Wilson, as its first keynote
speaker for LibrePlanet 2024, the sixteenth edition of the
FSF’s conference on ethical technology and user freedom.
LibrePlanet will be held in March in the Boston area as well as
online.
The State of Open Source Survey is underway!
The 2024 State of Open Source Survey is open and we welcome your participation!
The post <span class=’p-name’>The State of Open Source Survey is underway!</span> appeared first on Voices of Open Source.