コード例 #1
0
 function testIncorrectPurgePage()
 {
     $api = $this->getMockApi();
     $api->expects($this->once())->method('postRequest')->with($this->isInstanceOf('\\Mediawiki\\Api\\SimpleRequest'))->will($this->returnValue(["batchcomplete" => "", "purge" => [["ns" => 0, "title" => "This page really does not exist", "missing" => ""]]]));
     $service = new PagePurger($api);
     $page = new Page(new PageIdentifier(new Title('Foo', 0), 123));
     $this->assertFalse($service->purge($page));
 }
コード例 #2
0
 public function testPurgePage()
 {
     $api = $this->getMockApi();
     $api->expects($this->once())->method('postRequest')->with($this->isInstanceOf('\\Mediawiki\\Api\\SimpleRequest'))->will($this->returnValue('SOME no error RESULT'));
     $service = new PagePurger($api);
     $page = new Page(new PageIdentifier(new Title('Foo', 0), 123), new Revisions(array()));
     $this->assertTrue($service->purge($page));
 }