Esempio n. 1
0
 public function Status400TimeMapErrorResponseCommonTests($URIT, $statuscode, $outputfile, $debugfile)
 {
     global $sessionCookieString;
     $uagent = "Memento-Mediawiki-Plugin/Test";
     $curlCmd = "curl -v -s -A '{$uagent}' -b '{$sessionCookieString}' -k -i --url '{$URIT}'";
     $response = `{$curlCmd} 2> {$debugfile} | tee "{$outputfile}"`;
     $statusline = extractStatusLineFromResponse($response);
     $entity = extractEntityFromResponse($response);
     $this->assertEquals($statuscode, $statusline["code"]);
     # To catch any PHP errors that the test didn't notice
     $this->assertFalse(strpos($entity, "<b>Fatal error</b>"));
     # To catch any PHP notices that the test didn't notice
     $this->assertFalse(strpos($entity, "<b>Notice</b>"));
     # To catch any PHP notices that the test didn't notice
     $this->assertFalse(strpos($entity, "<b>Warning</b>"));
     # To ensure that the error message actually exists in the output
     $expected = acquireFormattedI18NString('en', 'timemap-404-title');
     $this->assertStringMatchesFormat("%A" . $expected . "%A", $entity);
 }
Esempio n. 2
0
 /**
  * @group all
  *
  * @dataProvider acquireEditUrls
  */
 public function testEditPage($URIR)
 {
     global $sessionCookieString;
     $uagent = "Memento-Mediawiki-Plugin/Test";
     $outputfile = __CLASS__ . '.' . __FUNCTION__ . '.' . self::$instance . '.txt';
     $debugfile = __CLASS__ . '.' . __FUNCTION__ . '-debug-' . self::$instance . '.txt';
     $curlCmd = "curl -v -s -A '{$uagent}' -b '{$sessionCookieString}' -k -i --url \"{$URIR}\"";
     $response = `{$curlCmd} 2> {$debugfile} | tee "{$outputfile}"`;
     $statusline = extractStatusLineFromResponse($response);
     $entity = extractEntityFromResponse($response);
     $this->assertEquals("200", $statusline["code"]);
     $this->StandardEntityTests($entity, $URIR);
 }