Finish the test for Monocle url rewriting (epubfs). re #52
這個提交存在於:
父節點
4993d08cdb
當前提交
15fe0401bc
共有 2 個檔案被更改,包括 30 行新增 和 0 行删除
|
|
@ -73,4 +73,34 @@ class EpubFsTest extends PHPUnit_Framework_TestCase
|
|||
}
|
||||
$this->assertEquals ('epubfs.php?data=20&comp=fonts~SLASH~times.ttf', $src);
|
||||
}
|
||||
|
||||
public function testDirectLink () {
|
||||
$data = getComponentContent (self::$book, "main10.xml", self::$add);
|
||||
|
||||
$src = "";
|
||||
if (preg_match("/href\='(.*?)' title=\"Direct Link\"/", $data, $matches)) {
|
||||
$src = $matches [1];
|
||||
}
|
||||
$this->assertEquals ('epubfs.php?data=20&comp=main2.xml', $src);
|
||||
}
|
||||
|
||||
public function testDirectLinkWithAnchor () {
|
||||
$data = getComponentContent (self::$book, "main10.xml", self::$add);
|
||||
|
||||
$src = "";
|
||||
if (preg_match("/href\='(.*?)' title=\"Direct Link with anchor\"/", $data, $matches)) {
|
||||
$src = $matches [1];
|
||||
}
|
||||
$this->assertEquals ('epubfs.php?data=20&comp=main2.xml#anchor', $src);
|
||||
}
|
||||
|
||||
public function testAnchorOnly () {
|
||||
$data = getComponentContent (self::$book, "main10.xml", self::$add);
|
||||
|
||||
$src = "";
|
||||
if (preg_match("/href\='(.*?)' title=\"Link to anchor\"/", $data, $matches)) {
|
||||
$src = $matches [1];
|
||||
}
|
||||
$this->assertEquals ('#anchor', $src);
|
||||
}
|
||||
}
|
||||
載入中…
新增表格
Add a link
新增問題並參考