Vvv: Class 'DOMDocument' not found

Created on 4 May 2016  路  5Comments  路  Source: Varying-Vagrant-Vagrants/VVV

Trying to run phpunit and getting this error. Doing some research pointed towards some sort of DOM module not being loaded? I don't know much about it though.

bug patch

Most helpful comment

I have run into the same issue while testing one plugin that used DOMDocument class, I would recommend to bundle php-xml which includes the dom module as well

this wasn't an issue with PHP5 the stable release was shipping with

for now I have fixed by ssh'ing into the box and installing the module like @joelworsham did

All 5 comments

I just found a solution. I ran sudo apt-get install php-xml.

Why is this required though? I've run phpunit in the bast (before VVV was on php7).

Hi @joelworsham, thanks for the report. Were you running phpunit with the WordPress core unit tests or for another project? I haven't needed to install php-xml for the core tests yet, but it's always possible something changed in php7.

It was with core tests. I used WP CLI to scaffold the project. I followed the instructions from Pippin's tutorial here: https://pippinsplugins.com/unit-tests-wordpress-plugins-setting-up-testing-suite/

I have run into the same issue while testing one plugin that used DOMDocument class, I would recommend to bundle php-xml which includes the dom module as well

this wasn't an issue with PHP5 the stable release was shipping with

for now I have fixed by ssh'ing into the box and installing the module like @joelworsham did

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

caseyallen386 picture caseyallen386  路  5Comments

ghost picture ghost  路  5Comments

rwrobe picture rwrobe  路  4Comments

westonruter picture westonruter  路  6Comments

GuerrillaCoder picture GuerrillaCoder  路  5Comments