1

I am working on a module Rate Limiter and trying to improve the deprecated SimpleTest with BrowserTest. While doing so, I get the following error.

C:\Project\Sites\devdesktop\drupal8>.\vendor\bin\phpunit -c .\core\phpunit.xml.dist --filter testRateLimitConfigPageVisit .\modules\custom\rate_limiter\tests\src\Functional\RateLimiterConfigFormTest.php PHPUnit 6.5.7 by Sebastian Bergmann and contributors.

Testing Drupal\Tests\rate_limiter\Functional\RateLimiterConfigFormTest
E                                                                   1 / 1 (100%)

Time: 56.75 seconds, Memory: 6.00MB

There was 1 error:

1) Drupal\Tests\rate_limiter\Functional\RateLimiterConfigFormTest::testRateLimitConfigPageVisit
Drupal\Core\Config\Schema\SchemaIncompleteException: No schema for rate_limiter.settings

C:\Project\Sites\devdesktop\drupal8\core\lib\Drupal\Core\Config\Development\ConfigSchemaChecker.php:88
C:\Project\Sites\devdesktop\drupal8\core\lib\Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher.php:111
C:\Project\Sites\devdesktop\drupal8\core\lib\Drupal\Core\Config\Config.php:227
C:\Project\Sites\devdesktop\drupal8\core\lib\Drupal\Core\Config\ConfigInstaller.php:334
C:\Project\Sites\devdesktop\drupal8\core\lib\Drupal\Core\Config\ConfigInstaller.php:134
C:\Project\Sites\devdesktop\drupal8\core\lib\Drupal\Core\ProxyClass\Config\ConfigInstaller.php:75
C:\Project\Sites\devdesktop\drupal8\core\lib\Drupal\Core\Extension\ModuleInstaller.php:268
C:\Project\Sites\devdesktop\drupal8\core\lib\Drupal\Core\ProxyClass\Extension\ModuleInstaller.php:83
C:\Project\Sites\devdesktop\drupal8\core\lib\Drupal\Core\Test\FunctionalTestSetupTrait.php:437
C:\Project\Sites\devdesktop\drupal8\core\tests\Drupal\Tests\BrowserTestBase.php:1026
C:\Project\Sites\devdesktop\drupal8\core\tests\Drupal\Tests\BrowserTestBase.php:490
C:\Project\Sites\devdesktop\drupal8\modules\custom\rate_limiter\tests\src\Functional\RateLimiterConfigFormTest.php:32

ERRORS!
Tests: 1, Assertions: 0, Errors: 1.

The Schema file is: https://github.com/aneek/rate_limiter/blob/develop/config/install/rate_limiter.settings.yml

And the Test File is: https://github.com/aneek/rate_limiter/blob/develop/tests/src/Functional/RateLimiterConfigFormTest.php

What I am missing?

4

The Schema file is: https://github.com/aneek/rate_limiter/blob/develop/config/install/rate_limiter.settings.yml

No, that is not the schema file, that is the config file for which you need to create a configuration schema.

Tests by default enforce that your configuration has a schema, which is useful for supporting configuration translation and additional upcoming functionality like validation.

See Configuration schema/metadata for more information on how to create that.

  • ahh thanks, @Berdir for correcting me. I will have a look tomorrow and let you know. – Aneek Mukhopadhyay Apr 1 '18 at 6:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.