From 456f051c4495459aee6e143dfa851e29a6028170 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Thu, 25 Jul 2019 23:38:50 +0100 Subject: [PATCH] phpunit: Avoid get_class() in MediaWikiCoversValidator MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit I notice that in CI, the inherited "testValidCovers" often shows multiple times for test classes as being slow (50ms+). E.g. from a quibble/php72 job: > … > 85ms to run ResourceLoaderWikiModuleTest:testValidCovers > … Bug: T225730 Change-Id: I524df134c52173c49ebb2b263a90bb5732255865 --- tests/phpunit/MediaWikiCoversValidator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/MediaWikiCoversValidator.php b/tests/phpunit/MediaWikiCoversValidator.php index a79a139c8a..ce3f2e281d 100644 --- a/tests/phpunit/MediaWikiCoversValidator.php +++ b/tests/phpunit/MediaWikiCoversValidator.php @@ -33,7 +33,7 @@ trait MediaWikiCoversValidator { */ public function testValidCovers() { $methods = get_class_methods( $this ); - $class = get_class( $this ); + $class = static::class; $bad = ''; foreach ( $methods as $method ) { if ( strpos( $method, 'test' ) === 0 ) { -- 2.20.1