MediaWiki REL1_31
MediaWikiCoversValidator.php
Go to the documentation of this file.
1<?php
28trait MediaWikiCoversValidator {
29
34 public function testValidCovers() {
35 $methods = get_class_methods( $this );
36 $class = get_class( $this );
37 $bad = '';
38 foreach ( $methods as $method ) {
39 if ( strpos( $method, 'test' ) === 0 ) {
40 try {
41 PHPUnit_Util_Test::getLinesToBeCovered( $class, $method );
42 } catch ( PHPUnit_Framework_CodeCoverageException $e ) {
43 $bad .= "$class::$method: {$e->getMessage()}\n";
44 }
45 }
46 }
47
48 $this->assertEquals( '', $bad );
49 }
50}
returning false will NOT prevent logging $e
Definition hooks.txt:2176