r91907 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91906‎ | r91907 | r91908 >
Date:20:08, 11 July 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
adding base for unit tests
Modified paths:
  • /trunk/extensions/Validator/Validator.hooks.php (added) (history)
  • /trunk/extensions/Validator/Validator.php (modified) (history)
  • /trunk/extensions/Validator/test (added) (history)
  • /trunk/extensions/Validator/test/ValidatorCriteriaTests.php (added) (history)

Diff [purge]

Index: trunk/extensions/Validator/test/ValidatorCriteriaTests.php
@@ -0,0 +1,16 @@
 2+<?php
 3+
 4+/**
 5+ * Unit tests for Validators criteria.
 6+ *
 7+ * @ingroup Validator
 8+ * @since 0.4.8
 9+ *
 10+ * @licence GNU GPL v3
 11+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
 12+ */
 13+class ValidatorCriteriaTests extends MediaWikiTestCase {
 14+
 15+ // TODO
 16+
 17+}
Property changes on: trunk/extensions/Validator/test/ValidatorCriteriaTests.php
___________________________________________________________________
Added: svn:eol-style
118 + native
Index: trunk/extensions/Validator/Validator.php
@@ -25,7 +25,7 @@
2626 die( 'Not an entry point.' );
2727 }
2828
29 -define( 'Validator_VERSION', '0.4.7' );
 29+define( 'Validator_VERSION', '0.4.8 alpha' );
3030
3131 // Register the internationalization file.
3232 $wgExtensionMessagesFiles['Validator'] = dirname( __FILE__ ) . '/Validator.i18n.php';
@@ -89,6 +89,9 @@
9090 $wgHooks['ParserFirstCallInit'][] = 'ValidatorDescribe::staticInit';
9191 $wgHooks['LanguageGetMagic'][] = 'ValidatorDescribe::staticMagic';
9292
 93+// Since 0.4.8
 94+$wgHooks['UnitTestsList'][] = 'MapsHooks::registerUnitTests';
 95+
9396 // This file needs to be included directly, since Validator_Settings.php
9497 // uses it, in some rare cases before autoloading is defined.
9598 require_once 'includes/ValidationError.php' ;
Index: trunk/extensions/Validator/Validator.hooks.php
@@ -0,0 +1,31 @@
 2+<?php
 3+
 4+/**
 5+ * Static class for hooks handled by the Validator extension.
 6+ *
 7+ * @since 0.4.8
 8+ *
 9+ * @file Validator.hooks.php
 10+ * @ingroup Validator
 11+ *
 12+ * @licence GNU GPL v3
 13+ * @author Jeroen De Dauw < jeroendedauw@gmail.com >
 14+ */
 15+final class ValidatorHooks {
 16+
 17+ /**
 18+ * Hook to add PHPUnit test cases.
 19+ *
 20+ * @since 0.4.8
 21+ *
 22+ * @param array $files
 23+ */
 24+ public static function registerUnitTests( array &$files ) {
 25+ $testDir = dirname( __FILE__ ) . '/test/';
 26+
 27+ $files[] = $testDir . 'ValidatorCriteriaTests.php';
 28+
 29+ return true;
 30+ }
 31+
 32+}
Property changes on: trunk/extensions/Validator/Validator.hooks.php
___________________________________________________________________
Added: svn:eol-style
133 + native

Follow-up revisions

RevisionCommit summaryAuthorDate
r91960follow up to r91907jeroendedauw14:02, 12 July 2011