Fix WikitextContent::getSection() for missing sections
authorTim Starling <tstarling@wikimedia.org>
Mon, 15 Oct 2012 00:49:28 +0000 (11:49 +1100)
committerTim Starling <tstarling@wikimedia.org>
Mon, 15 Oct 2012 00:49:28 +0000 (11:49 +1100)
commit16f25691ea5382eb333bcd6801e714727e68704e
tree49eda7172ab738d29e676c85be4fc00820f59950
parent0d78e4aedb4c07dadf0dc4017e6f2c3dd381ec58
Fix WikitextContent::getSection() for missing sections

Make WikitextContent::getSection() return false when the section is
missing, as per the documented behaviour for Content::getSection(). Fix
a test so that it doesn't generate a PHP fatal error if getSection()
returns false.

Should fix the current Jenkins build failure:

https://integration.mediawiki.org/ci/job/MediaWiki-Tests-Misc/6989/testReport/junit/%28root%29/WikitextContentTest__testGetSection/testGetSection_with_data_set__2/

Change-Id: Ifa85f8eed50943d8ece32555d06b3e989077da46
includes/content/WikitextContent.php
tests/phpunit/includes/WikitextContentTest.php