Check that empty content is valid only on handlers that allow direct editing.
authorStanislav Malyshev <smalyshev@gmail.com>
Wed, 15 Feb 2017 23:15:41 +0000 (15:15 -0800)
committerStanislav Malyshev <smalyshev@gmail.com>
Wed, 15 Feb 2017 23:15:41 +0000 (15:15 -0800)
Bug: T157626
Change-Id: I843f25172b70111f8219eec9a853ac3138c6aff3

tests/phpunit/structure/ContentHandlerSanityTest.php

index 98a0fbb..30bae78 100644 (file)
@@ -45,9 +45,12 @@ class ContentHandlerSanityTest extends MediaWikiTestCase {
                $handlerClass = get_class( $handler );
                $contentClass = get_class( $content );
 
-               $this->assertTrue(
-                       $content->isValid(),
-                       "$handlerClass::makeEmptyContent() did not return a valid content ($contentClass::isValid())"
-               );
+               if ( $handler->supportsDirectEditing() ) {
+                       $this->assertTrue(
+                               $content->isValid(),
+                               "$handlerClass::makeEmptyContent() did not return a valid content ($contentClass::isValid())"
+                       );
+               }
        }
+
 }