}
}
+ /*
+ * Test if we become a "Created blank page" summary from getAutoSummary if no Content added to
+ * page.
+ */
+ public function testGetAutosummary() {
+ $content = new DummyContentHandlerForTesting( CONTENT_MODEL_WIKITEXT );
+ $title = Title::newFromText( 'Help:Test' );
+ // Create a new content object with no content
+ $newContent = ContentHandler::makeContent( '', $title, null, null, CONTENT_MODEL_WIKITEXT );
+ // first check, if we become a blank page created summary with the right bitmask
+ $autoSummary = $content->getAutosummary( null, $newContent, 97 );
+ $this->assertEquals( $autoSummary, 'Created blank page' );
+ // now check, what we become with another bitmask
+ $autoSummary = $content->getAutosummary( null, $newContent, 92 );
+ $this->assertEquals( $autoSummary, '' );
+ }
+
/*
public function testSupportsSections() {
$this->markTestIncomplete( "not yet implemented" );
* Returns native represenation of the data. Interpretation depends on the data model used,
* as given by getDataModel().
*
- * @return mixed the native representation of the content. Could be a string, a nested array
+ * @return mixed The native representation of the content. Could be a string, a nested array
* structure, an object, a binary blob... anything, really.
*/
public function getNativeData() {
* return $this. That is, $copy === $original may be true, but only for imutable content
* objects.
*
- * @return Content. A copy of this object.
+ * @return Content A copy of this object
*/
public function copy() {
return $this;
* Returns true if this content is countable as a "real" wiki page, provided
* that it's also in a countable location (e.g. a current revision in the main namespace).
*
- * @param bool $hasLinks if it is known whether this content contains links,
+ * @param bool $hasLinks If it is known whether this content contains links,
* provide this information here, to avoid redundant parsing to find out.
* @return bool
*/
* @param Title $title
* @param int $revId Unused.
* @param null|ParserOptions $options
- * @param bool $generateHtml whether to generate Html (default: true). If false, the result
+ * @param bool $generateHtml Whether to generate Html (default: true). If false, the result
* of calling getText() on the ParserOutput object returned by this method is undefined.
*
* @return ParserOutput
) {
return new ParserOutput( $this->getNativeData() );
}
+
+ /**
+ * @see AbstractContent::fillParserOutput()
+ *
+ * @param Title $title Context title for parsing
+ * @param int|null $revId Revision ID (for {{REVISIONID}})
+ * @param ParserOptions $options Parser options
+ * @param bool $generateHtml Whether or not to generate HTML
+ * @param ParserOutput &$output The output object to fill (reference).
+ */
+ protected function fillParserOutput( Title $title, $revId,
+ ParserOptions $options, $generateHtml, ParserOutput &$output ) {
+ $output = new ParserOutput( $this->getNativeData() );
+ }
}