From 15fe0401bcd72a65449ffa6b6c14db256016eef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Thu, 20 Feb 2014 08:49:18 +0100 Subject: [PATCH] Finish the test for Monocle url rewriting (epubfs). re #52 --- ...entures in Wonderland - Lewis Carroll.epub | Bin 1597648 -> 1597594 bytes test/EpubFsTest.php | 30 ++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/test/BaseWithSomeBooks/Lewis Carroll/Alice's Adventures in Wonderland (17)/Alice's Adventures in Wonderland - Lewis Carroll.epub b/test/BaseWithSomeBooks/Lewis Carroll/Alice's Adventures in Wonderland (17)/Alice's Adventures in Wonderland - Lewis Carroll.epub index 272af521445e4d7bb339ef4673872bf9786d2d96..376ab504e04ca24bdbc99d7dd87f349cfba720a4 100644 GIT binary patch delta 5122 zcmZXYRZtWFw}2_>Zlt>#WQheNB&54jN=iZ+mRPz&mJaFIML=450f_~qOS(Ix1%Chg zbm!hPbLN}*p3a=dZ?e}qr`I|Zj0{Erqk_@EufXVF3@|1b3yclM0po)4!1!PSFd>)- zObjLglY+^>h^K6WHMf#lFfvcK5@di~x0X`?10pFi22TH@;M-b%;X5BCB#yWL0#!l8Nj7=beZyj>E0Pm(V@ zeTw6icpbQA2s(xOa&>!XDqd;ahuTGtD{fI=xjL%OhgDu8oT;KOzPO*N?^Wk29w&c^ z58Qi*T=aDdY+Qi*nVYWFp4(YJ*y4N*ywwHqcGn4uW%Pe}^f)IFi@(iCt&zknXtY}< zXIZ41(nkj3-2bqC6S%B6zZMhvdH9H>@-s*B9mi9|B1rFz+-gvRa&nM=W6yT8@9$gw z&hRQB`ye(H&<0e@);YJ)klxxKH>(>pIM^ZA2rD?gWpz5$-NNgq>8|$|0gR8S$jy5JG#u@V;J%wdT#@55wL#T#)H0Mkp;x;(a6TK1TGL# z`SP%1XsXYK?h=NG8@UDUn?J%5OU|Lv+lUtjp83xbc{yoZ`F&B4|t5F9^`-R zv1o~D*G_}a#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>)P|2nzpTYXyGXplB_toi~NC{GEHXZwNsOC_5o?W5}?xn}#7UG9S) z38%3A6a6TK6=O@m7k~8b_`Y#&X+95TVPip>n9yCQ>StBUMETnu zRh+$UJwhExi&qayILY*UjVjH{OsU)hsSW7?Y|38hhKhjmldhHig|Gca4P-7hr-9_;zKti+>^G(&MRmts3BEfKb8F zn3&GNv)OeRTa7qL<;8CEnvZIG z(3bwOi!wq`aWUPp3=kmL2J&)tl`dkzgx%+ob_0a%a!0%H@%);uIf~>jwRKLj_*nZZ zG3%f7(dnbYP()<8K#pl*`M z)+MD4Z=5tk7Mi{#l56qtf{k9A8=lN zjwGZAguOY|F@K#TXQdfZdS1In%Z8}tnQWYkOc8YMRwgcn&-379$LeC{!$zJO5)F0*Y zyMN2qSK5>fo7eO6{aGArA>~7L_zimybb%r3YGPe$grOdE(|m(_+G6@PRFzfIdTb!g zLpbi>@b`KzB!KzW?etm_7347IiMi{$X1>m#4t+Ple8{-Xdy6OL&mMM=UyC1s9%3Ic zG=6|^&F-7tN#RPmjAWMF^tHz0i++4taeruMF2?$G#^!TFSnjvP@;S_g?ujy^=y+vY z=F0?W7#5@LIiU0r)BqNrXP`exa)*fJIoeE;f$yjjt;srvB)Ac!61Iv{*c$pq;!6Uh z>P(Gti0ee&nUN!Rcd^u89M(E4n43ySnc2amz&hE@+~ymxg7@l?3lOEm+7@6qwSP%| z3&?6?<}~ESsjZ{>Zc6`f{tJ;`nZDus)vt>G2e+?w7v<%ba8wuwEKmViKqE&J zjO7vl0Mjl201f~c00000009610HlG$V;2BVP*X2$VQFqLFqgnz7$}$gTo@h!@s}H2 z7*heGmv3DdQVmm|7XVLCQ!i~{X>K!@AzTsVrk7z~7*YYFm$Y9PQUR=&2VfXf0vJ)3U0@h93X%-~04P%!00009 C*8OMz diff --git a/test/EpubFsTest.php b/test/EpubFsTest.php index e569771..8bc817b 100644 --- a/test/EpubFsTest.php +++ b/test/EpubFsTest.php @@ -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); + } } \ No newline at end of file