MediaWiki REL1_31
ExtensionJsonValidationTest.php
Go to the documentation of this file.
1<?php
23class ExtensionJsonValidationTest extends PHPUnit\Framework\TestCase {
24
25 use MediaWikiCoversValidator;
26
30 protected $validator;
31
32 public function setUp() {
33 parent::setUp();
34
35 $this->validator = new ExtensionJsonValidator( [ $this, 'markTestSkipped' ] );
36 $this->validator->checkDependencies();
37
38 if ( !ExtensionRegistry::getInstance()->getAllThings() ) {
39 $this->markTestSkipped(
40 'There are no extensions or skins loaded via the ExtensionRegistry'
41 );
42 }
43 }
44
45 public static function providePassesValidation() {
46 $values = [];
47 foreach ( ExtensionRegistry::getInstance()->getAllThings() as $thing ) {
48 $values[] = [ $thing['path'] ];
49 }
50
51 return $values;
52 }
53
58 public function testPassesValidation( $path ) {
59 try {
60 $this->validator->validate( $path );
61 // All good
62 $this->assertTrue( true );
64 $this->assertEquals( false, $e->getMessage() );
65 }
66 }
67}
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Ge...
testPassesValidation( $path)
providePassesValidation
returning false will NOT prevent logging $e
Definition hooks.txt:2176