Currently, php-test-standalone-plugins workflow (via the test-plugins command) is just checking to see if each standalone plugin causes a fatal when it is active in isolation from the other plugins:
|
public function test_plugin_does_not_fatal() { |
|
return $this->assertTrue( true ); |
|
} |
This seems like using the wrong tool, PHPUnit, for the job. Indeed, PHPStan flags this assertion as an error:
phpstan: Call to method PHPUnit\Framework\Assert::assertTrue() with true will always evaluate to true.
It seems better to not use PHPUnit here, but rather to use curl to fetch the homepage and make sure it returns a 200 status code and includes </html> in the response body. Even better would be to start using Playwright to do actual E2E tests.
I also think the test-plugins command should also be renamed to reduce confusion with test-php-plugins and test-php, for example, test-e2e.
Originally discussed in #1044 (comment) and #1044 (comment).
Currently, php-test-standalone-plugins workflow (via the test-plugins command) is just checking to see if each standalone plugin causes a fatal when it is active in isolation from the other plugins:
performance/plugin-tests/tests/test-standalone.php
Lines 13 to 15 in 06d6ffe
This seems like using the wrong tool, PHPUnit, for the job. Indeed, PHPStan flags this assertion as an error:
It seems better to not use PHPUnit here, but rather to use
curlto fetch the homepage and make sure it returns a 200 status code and includes</html>in the response body. Even better would be to start using Playwright to do actual E2E tests.I also think the test-plugins command should also be renamed to reduce confusion with test-php-plugins and test-php, for example, test-e2e.
Originally discussed in #1044 (comment) and #1044 (comment).