public function __construct($title) { $this->title = $title; switch ($title->getPrefixedDBKey()) { case 'Modeling_test_article': $this->user = MwRdfTest::createUserWithRealName(); $this->content = MwRdfTest::InPageWikitext(); $this->time = 1; // 1 January 1970, 1 second after midnight UTC break; default: $this->time = 1; // 1 January 1970, 1 second after midnight UTC } }
public function testSpecialPageProducesCorrectHistoryModel() { $this->format = 'turtle'; $parser = MwRdf::Parser('turtle'); $this->prepareRequest(null, array('history')); $text = wfRdfSpecialPage(null); $model = MwRdf::Model(); $model->loadStatementsFromString($parser, $text); $expect = MwRdfTest::createExpectedHistoryModel(); $this->assertModelEqualsModel($expect, $model); }
public function testCateogriesModel() { $title = $this->agent->getArticle()->getTitle(); $title->setParentCategories(array("Category:Red", "Category:Green", "Category:Blue")); $this->agent->registerModelMaker('MwRdf_Categories_Modeler'); $model = $this->agent->buildModel('categories'); $expect = MwRdfTest::createExpectedCategoriesModel(); $this->assertModelEqualsModel($expect, $model); }
public function testQueryProducesExpectedModel() { $this->agent->storeModel('inpage'); $model = $this->agent->retrieveModel('inpage'); $expect = MwRdfTest::createExpectedInPageModel(); $this->assertModelEqualsModel($expect, $model); }
public function testPersonToResource_AnonymousUser() { $user = MwRdfTest::CreateAnonymousUser(); $res = MwRdf::PersonToResource(0, null, null); $this->assertTrue($res instanceof LibRDF_LiteralNode); $this->assertEquals('anonymous', "{$res}"); }