Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 305144

Drupal PHPUnit tests currently NEED the profiles directory to exist

$
0
0

Problem/Motivation

I have built my own Drupal 8 using composer and it only includes the code that is required. Any core, contrib or third party code is not kept in the repository and it is installed via composer.

As a result, the root "profiles" directory does not exist because the site is not using profiles.

When executing PHPUnit using the standard phpunit.xml.dist file, the core/bootstrap.php crashes with the error:

UnexpectedValueException: RecursiveDirectoryIterator::__construct(C:\Webs\mysite\docroot\profiles,C:\Webs\mysite\docroot\profiles): The system cannot find the file specified. (code: 2) in C:\Webs\mysite\docroot\core\tests\bootstrap.php on line 22

Proposed resolution

There is a decision to be made here because there are two possible resolutions:

Drupal REQUIRES the profiles directory to exist, and therefore all sites using a composer-based build will NEED to have at least a README.txt in the profiles directory

There will be no core changes required here, but all documentation that informs the user on building a Drupal site from scratch using only composer will need to be updated to specifically mention that if you want to run unit tests, you HAVE to have a profiles directory (and if adding it to git, it will need to have at least one file in it, because git will not accept empty directories).

Drupal does not require the profiles directory to exist

The supplied patch will fix the issue.

Remaining tasks

Decide whether Drupal is going to REQUIRE the profiles directory to exist.

Credit

Patch and debugging help provided by dawehner.


Viewing all articles
Browse latest Browse all 305144

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>