Better testing of Data object
這個提交存在於:
		
							父節點
							
								
									76b7089028
								
							
						
					
					
						當前提交
						980446d9c6
					
				
					共有  1 個檔案被更改,包括 14 行新增 和 0 行删除
				
			
		|  | @ -179,12 +179,26 @@ class BookTest extends PHPUnit_Framework_TestCase | |||
|      | ||||
|     public function testGetDataById () | ||||
|     { | ||||
|         global $config; | ||||
|          | ||||
|         // Get Alice MOBI=>17, PDF=>19, EPUB=>20
 | ||||
|         $book = Book::getBookById(17); | ||||
|         $data = $book->getDataById (17); | ||||
|         $this->assertEquals ("MOBI", $data->format); | ||||
|         $data = $book->getDataById (20); | ||||
|         $this->assertEquals ("EPUB", $data->format); | ||||
|         $this->assertEquals ("Carroll, Lewis - Alice's Adventures in Wonderland.epub", $data->getUpdatedFilenameEpub ()); | ||||
|         $this->assertEquals ("Carroll, Lewis - Alice's Adventures in Wonderland.kepub.epub", $data->getUpdatedFilenameKepub ()); | ||||
|         $this->assertEquals (dirname(__FILE__) . "/BaseWithSomeBooks/Lewis Carroll/Alice's Adventures in Wonderland (17)/Alice's Adventures in Wonderland - Lewis Carroll.epub", $data->getLocalPath ()); | ||||
|          | ||||
|         $config['cops_use_url_rewriting'] = "1"; | ||||
|         $config['cops_provide_kepub'] = "1"; | ||||
|         $_SERVER["HTTP_USER_AGENT"] = "Kobo"; | ||||
|         $this->assertEquals ("download/20/Carroll%2C+Lewis+-+Alice%27s+Adventures+in+Wonderland.kepub.epub", $data->getHtmlLink ()); | ||||
|         $_SERVER["HTTP_USER_AGENT"] = "Firefox"; | ||||
|         $this->assertEquals ("download/20/Alice%27s+Adventures+in+Wonderland+-+Lewis+Carroll.epub", $data->getHtmlLink ()); | ||||
|         $config['cops_use_url_rewriting'] = "0"; | ||||
|         $this->assertEquals ("fetch.php?data=20&type=epub&id=17", $data->getHtmlLink ()); | ||||
|     } | ||||
|      | ||||
|     public function testTypeaheadSearch () | ||||
|  |  | |||
		載入中…
	
	新增表格
		Add a link
		
	
		新增問題並參考