From 85fd9d4fb4515d621a0a450dad8bd7f1cc19dd71 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Wed, 15 Feb 2017 15:15:41 -0800 Subject: [PATCH] Check that empty content is valid only on handlers that allow direct editing. Bug: T157626 Change-Id: I843f25172b70111f8219eec9a853ac3138c6aff3 --- tests/phpunit/structure/ContentHandlerSanityTest.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/structure/ContentHandlerSanityTest.php b/tests/phpunit/structure/ContentHandlerSanityTest.php index 98a0fbbfd5..30bae78ce3 100644 --- a/tests/phpunit/structure/ContentHandlerSanityTest.php +++ b/tests/phpunit/structure/ContentHandlerSanityTest.php @@ -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())" + ); + } } + } -- 2.20.1