Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P12950
(An Untitled Masterwork)
Active
Public
Actions
Authored by
EBernhardson
on Oct 7 2020, 6:50 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F32377291: raw-paste-data.txt
Oct 7 2020, 6:50 PM
2020-10-07 18:50:32 (UTC+0)
Subscribers
None
public function testSomething() {
$content = <<<EOD
Some opening text
== first heading ==
content
<div class="navigation-not-searchable">excluded</div>
== second heading ==
content
<div class="searchaux">auxiliary</div>
EOD;
self::editPage( 'UTSearchIndexingTest', $content );
$title = Title::makeTitle( NS_MAIN, 'UTSearchIndexingTest' );
$page = new WikiPage( $title );
$contentHandler = $page->getContentHandler();
$parserCache = null;
$output = $contentHandler->getParserOutputForIndexing( $page, $parserCache );
$fieldContent = $contentHandler->getDataForSearchIndex( $page, $output, new \CirrusSearch\CirrusSearch );
$this->assertEquals( 'Some opening text', $fieldContent['opening_text'] );
$this->assertCount( 1, $fieldContent['auxiliary_text'] );
$this->assertEquals( 'auxiliary', $fieldContent['auxiliary_text'][0] );
$this->assertEquals( 'Some opening text content content', $fieldContent['text'] );
}
Event Timeline
EBernhardson
created this paste.
Oct 7 2020, 6:50 PM
2020-10-07 18:50:32 (UTC+0)
Log In to Comment