Hi everyone !
I would like run my unit tests but I have this error :
$ vendor/bin/phpunit -c tests/phpunit.unit.xml --fail-on-warning
Impossible d’écrire dans le répertoire « config » !
Ce problème est généralement résolu en donnant au serveur web un accès en écriture au répertoire "config"
Ou, si vous préférez conserver le fichier config.php en lecture seule, définissez l'option "config_is_read_only" sur true.
Voir https://docs.nextcloud.com/server/21/go.php?to=admin-config
So, I tried to define the config_is_read_only
var to false
but I have still the same problem
I wonder if my problem come from my bootstrap.php
and phpunit.unut.xml
config files ?
There is my configuration :
phpunit.unit.xml
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="bootstrap.php" verbose="true" timeoutForSmallTests="900" timeoutForMediumTests="900" timeoutForLargeTests="900" cacheResult="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<testsuite name="Workspace app tests">
<directory suffix="Test.php">Unit</directory>
</testsuite>
</phpunit>
bootstrap.php
<?php
if (!defined('PHPUNIT_RUN')) {
define('PHPUNIT_RUN', 1);
}
require_once __DIR__.'/../../../lib/base.php';
// Fix for "Autoload path not allowed: .../tests/lib/testcase.php"
\OC::$loader->addValidRoot(OC::$SERVERROOT . '/tests');
// Fix for "Autoload path not allowed: .../workspace/tests/testcase.php"
\OC_App::loadApp('workspace');
OC_Hook::clear();
What do you think ?