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

Fix strict type errors in functional javascript tests

$
0
0

Problem/Motivation

This is a child issue of #3376057: [META] Add declare(strict_types=1) to all tests. After adding enabling strict types to all tests there were around 3000 errors. Fixing them all in one issue will lead to an enormous merge request that's difficult to review, as per the issue scope guidelines.

Steps to reproduce

Create the rector.php file:

<?php

use Rector\Config\RectorConfig;
use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector;

return static function (RectorConfig $rectorConfig): void {
  $rectorConfig->rule(DeclareStrictTypesRector::class);
};

Process all functional javascript tests:

composer require rector/rector --dev
php ./vendor/bin/rector process core/tests/Drupal/FunctionalJavascriptTests
for file in $(find core -type d -name "tests" -exec find {} -type d -name "FunctionalJavascript" \;); do
    php ./vendor/bin/rector process $file
done

Run the test suite:

./vendor/bin/phpunit -c core/phpunit.xml.dist --bootstrap=core/tests/bootstrap.php --testsuite=functional-javascript

Proposed resolution

  • Fix all strict type issues in functional javascript tests
  • Follow up [@todo create follow up issue]

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 293406

Trending Articles



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