From 28292b83a08ce6be487515f7a3c24028660d870e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Tue, 29 Apr 2014 15:16:25 +0200 Subject: [PATCH] Add a new book in the test database. it will allow test for accentuated character search. --- test/BaseWithSomeBooks/metadata.db | Bin 194560 -> 195584 bytes test/bookTest.php | 12 ++++----- test/pageMultidatabaseTest.php | 4 +-- test/pageTest.php | 41 +++++++++++++++-------------- 4 files changed, 29 insertions(+), 28 deletions(-) diff --git a/test/BaseWithSomeBooks/metadata.db b/test/BaseWithSomeBooks/metadata.db index 6312b8ed7d670c68713e8c4956dfb3028177b23f..f049dd257b89d931bd12bd304a4906af6845779f 100644 GIT binary patch delta 3567 zcmb7H4R93Y8Q%AM_kNOGyvxM^hM#PHAfdS=cb6l7LU7(8FFz0}F7IF38?h_HaMs^>R6g+3?F9tHBJXtUS7B+l@RY+(kmw!&0stpsTY6ko*Wa4(hoV{%bsyWsWbZe2~_gB<<|PvR+pp2joyIevv>IF1Jiy!(RZB7N+R zg;1kAqN`vu6OFEAB|ZQjPAcByS&%uprX4KYIvcmn#`)j|8|QN_&T&(4Q|9RU zc85D3U#AW3P{tEKj1F3Do1q`?4oxm=R%Uo(bOsdZj%`(V5SJ29KGfSE5*Wwn>mS-s zkk3O2_?L9tc6~|a)raQ$V7l(u)y(h_bHi%b!StYentuA1PZs5YE3L>mw5)a}XJ&Ri z-ox_@&vK?O&PJ(^+%?mj47uViMRWo^rDS(LCH75-+l9qI2$nhjtjj~)^5VY{{F$#u zJiIr9|Ac?BX>1Am2f8qzm%BrmTSj|8&yMcUugPX%j`5ezSf%^Hn`<20(j9A!JHKR4 z8tV#~+wgeU42y;5Yxa%RpkwYFTnYNh(F*;0N17cq<+v1#_da7YVU9j@WUb$c8#z2q z7vbkPh#T=7o+DnCpbtOceC6DtgtS>q#ua&uzVY`D&f@djJU5l=NX2@jeEgJi;wBDX z!aw3J{2_jk@x9hTq<_kJFPXXYO>f*^z~|vq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`>uwV8c#rl2eV;ae;j5U3xz7R2<)F4z)dX%+sL|fik<15$vFFUlHHo7A&w#IQe7RZ zhs77+W_M&6)M`+v^afZCao28u*D*9J9QI<6RB61^FyYrEh|A?#w&5n47pxUjDlhke4|#bCyaazy_u^gXM3fX76G$ zPHJ5X6eFcoM+^MU>yJ4Zd#lkFh+XJe&ztUdZD45Zl>eju%P!ErXYHRzUG;B)8LeNW zbY1%okZLc?!Fs`V`x7OphD;p86t<(+o#vxaRiXJei4uUDjJPeMWZ#*D8~!M;*GfR{tKs0{7B!JWcS1t9`<2z+ctWQT(M_^EntKP#u0ONFZcK`qY diff --git a/test/bookTest.php b/test/bookTest.php index 8defd10..026b4b3 100644 --- a/test/bookTest.php +++ b/test/bookTest.php @@ -50,7 +50,7 @@ class BookTest extends PHPUnit_Framework_TestCase public function testGetBookCount () { - $this->assertEquals (14, Book::getBookCount ()); + $this->assertEquals (15, Book::getBookCount ()); } public function testGetCount () @@ -59,7 +59,7 @@ class BookTest extends PHPUnit_Framework_TestCase $this->assertEquals (2, count($entryArray)); $entryAllBooks = $entryArray [0]; - $this->assertEquals ("Alphabetical index of the 14 books", $entryAllBooks->content); + $this->assertEquals ("Alphabetical index of the 15 books", $entryAllBooks->content); $entryRecentBooks = $entryArray [1]; $this->assertEquals ("50 most recent books", $entryRecentBooks->content); @@ -170,7 +170,7 @@ class BookTest extends PHPUnit_Framework_TestCase $config['cops_recentbooks_limit'] = 50; $entryArray = Book::getAllRecentBooks (); - $this->assertCount (14, $entryArray); + $this->assertCount (15, $entryArray); } public function testGetBookById () @@ -380,10 +380,10 @@ class BookTest extends PHPUnit_Framework_TestCase $array = JSONRenderer::getJson (); - $this->assertCount (4, $array); + $this->assertCount (5, $array); $this->assertEquals ("1 author", $array[0]["title"]); $this->assertEquals ("Doyle, Arthur Conan", $array[1]["title"]); - $this->assertEquals ("1 series", $array[2]["title"]); + $this->assertEquals ("2 series", $array[2]["title"]); $this->assertEquals ("D'Artagnan Romances", $array[3]["title"]); $_GET["query"] = "Macmillan"; @@ -445,7 +445,7 @@ class BookTest extends PHPUnit_Framework_TestCase $this->assertCount (5, $array); $this->assertEquals ("Some books", $array[0]["title"]); $this->assertEquals ("1 author", $array[1]["title"]); - $this->assertEquals ("1 series", $array[2]["title"]); + $this->assertEquals ("2 series", $array[2]["title"]); $this->assertEquals ("One book", $array[3]["title"]); $this->assertEquals ("1 book", $array[4]["title"]); diff --git a/test/pageMultidatabaseTest.php b/test/pageMultidatabaseTest.php index f996a02..dce34a9 100644 --- a/test/pageMultidatabaseTest.php +++ b/test/pageMultidatabaseTest.php @@ -27,7 +27,7 @@ class PageMultiDatabaseTest extends PHPUnit_Framework_TestCase $this->assertEquals ($config['cops_title_default'], $currentPage->title); $this->assertCount (2, $currentPage->entryArray); $this->assertEquals ("Some books", $currentPage->entryArray [0]->title); - $this->assertEquals ("14 books", $currentPage->entryArray [0]->content); + $this->assertEquals ("15 books", $currentPage->entryArray [0]->content); $this->assertEquals ("One book", $currentPage->entryArray [1]->title); $this->assertEquals ("1 book", $currentPage->entryArray [1]->content); $this->assertFalse ($currentPage->ContainsBook ()); @@ -55,7 +55,7 @@ class PageMultiDatabaseTest extends PHPUnit_Framework_TestCase $this->assertEquals ("Search result for *art*", $currentPage->title); $this->assertCount (2, $currentPage->entryArray); $this->assertEquals ("Some books", $currentPage->entryArray [0]->title); - $this->assertEquals ("10 books", $currentPage->entryArray [0]->content); + $this->assertEquals ("11 books", $currentPage->entryArray [0]->content); $this->assertEquals ("One book", $currentPage->entryArray [1]->title); $this->assertEquals ("1 book", $currentPage->entryArray [1]->content); $this->assertFalse ($currentPage->ContainsBook ()); diff --git a/test/pageTest.php b/test/pageTest.php index 1413bc5..718b960 100644 --- a/test/pageTest.php +++ b/test/pageTest.php @@ -25,19 +25,19 @@ class PageTest extends PHPUnit_Framework_TestCase $this->assertEquals ($config['cops_title_default'], $currentPage->title); $this->assertCount (8, $currentPage->entryArray); $this->assertEquals ("Authors", $currentPage->entryArray [0]->title); - $this->assertEquals ("Alphabetical index of the 5 authors", $currentPage->entryArray [0]->content); + $this->assertEquals ("Alphabetical index of the 6 authors", $currentPage->entryArray [0]->content); $this->assertEquals ("Series", $currentPage->entryArray [1]->title); - $this->assertEquals ("Alphabetical index of the 3 series", $currentPage->entryArray [1]->content); + $this->assertEquals ("Alphabetical index of the 4 series", $currentPage->entryArray [1]->content); $this->assertEquals ("Publishers", $currentPage->entryArray [2]->title); - $this->assertEquals ("Alphabetical index of the 5 publishers", $currentPage->entryArray [2]->content); + $this->assertEquals ("Alphabetical index of the 6 publishers", $currentPage->entryArray [2]->content); $this->assertEquals ("Tags", $currentPage->entryArray [3]->title); - $this->assertEquals ("Alphabetical index of the 10 tags", $currentPage->entryArray [3]->content); + $this->assertEquals ("Alphabetical index of the 11 tags", $currentPage->entryArray [3]->content); $this->assertEquals ("Ratings", $currentPage->entryArray [4]->title); $this->assertEquals ("3 ratings", $currentPage->entryArray [4]->content); $this->assertEquals ("Languages", $currentPage->entryArray [5]->title); - $this->assertEquals ("Alphabetical index of the single language", $currentPage->entryArray [5]->content); + $this->assertEquals ("Alphabetical index of the 2 languages", $currentPage->entryArray [5]->content); $this->assertEquals ("All books", $currentPage->entryArray [6]->title); - $this->assertEquals ("Alphabetical index of the 14 books", $currentPage->entryArray [6]->content); + $this->assertEquals ("Alphabetical index of the 15 books", $currentPage->entryArray [6]->content); $this->assertEquals ("Recent additions", $currentPage->entryArray [7]->title); $this->assertEquals ("50 most recent books", $currentPage->entryArray [7]->content); $this->assertFalse ($currentPage->ContainsBook ()); @@ -60,7 +60,7 @@ class PageTest extends PHPUnit_Framework_TestCase $this->assertCount (3, $currentPage->entryArray); $this->assertEquals ("Ratings", $currentPage->entryArray [0]->title); $this->assertEquals ("All books", $currentPage->entryArray [1]->title); - $this->assertEquals ("Alphabetical index of the 14 books", $currentPage->entryArray [1]->content); + $this->assertEquals ("Alphabetical index of the 15 books", $currentPage->entryArray [1]->content); $this->assertEquals ("Recent additions", $currentPage->entryArray [2]->title); $this->assertEquals ("50 most recent books", $currentPage->entryArray [2]->content); $this->assertFalse ($currentPage->ContainsBook ()); @@ -207,7 +207,7 @@ class PageTest extends PHPUnit_Framework_TestCase $currentPage->InitializeContent (); $this->assertEquals ("Authors", $currentPage->title); - $this->assertCount (5, $currentPage->entryArray); + $this->assertCount (6, $currentPage->entryArray); $this->assertEquals ("Carroll, Lewis", $currentPage->entryArray [0]->title); $this->assertFalse ($currentPage->ContainsBook ()); @@ -217,7 +217,7 @@ class PageTest extends PHPUnit_Framework_TestCase $currentPage->InitializeContent (); $this->assertEquals ("Authors", $currentPage->title); - $this->assertCount (4, $currentPage->entryArray); + $this->assertCount (5, $currentPage->entryArray); $this->assertEquals ("C", $currentPage->entryArray [0]->title); $this->assertFalse ($currentPage->ContainsBook ()); } @@ -301,7 +301,7 @@ class PageTest extends PHPUnit_Framework_TestCase $currentPage->InitializeContent (); $this->assertEquals ("All books", $currentPage->title); - $this->assertCount (14, $currentPage->entryArray); + $this->assertCount (15, $currentPage->entryArray); $this->assertEquals ("The Adventures of Sherlock Holmes", $currentPage->entryArray [0]->title); $this->assertEquals ("Alice's Adventures in Wonderland", $currentPage->entryArray [1]->title); $this->assertTrue ($currentPage->ContainsBook ()); @@ -328,8 +328,8 @@ class PageTest extends PHPUnit_Framework_TestCase $currentPage = Page::getPage ($page, $qid, $query, $n); $currentPage->InitializeContent (); - $this->assertEquals ("2 books starting with C", $currentPage->title); - $this->assertCount (2, $currentPage->entryArray); + $this->assertEquals ("3 books starting with C", $currentPage->title); + $this->assertCount (3, $currentPage->entryArray); $this->assertEquals ("The Call of the Wild", $currentPage->entryArray [0]->title); $this->assertTrue ($currentPage->ContainsBook ()); } @@ -345,7 +345,7 @@ class PageTest extends PHPUnit_Framework_TestCase $currentPage->InitializeContent (); $this->assertEquals ("Series", $currentPage->title); - $this->assertCount (3, $currentPage->entryArray); + $this->assertCount (4, $currentPage->entryArray); $this->assertEquals ("D'Artagnan Romances", $currentPage->entryArray [0]->title); $this->assertFalse ($currentPage->ContainsBook ()); } @@ -376,7 +376,7 @@ class PageTest extends PHPUnit_Framework_TestCase $currentPage->InitializeContent (); $this->assertEquals ("Publishers", $currentPage->title); - $this->assertCount (5, $currentPage->entryArray); + $this->assertCount (6, $currentPage->entryArray); $this->assertEquals ("D. Appleton and Company", $currentPage->entryArray [0]->title); $this->assertFalse ($currentPage->ContainsBook ()); } @@ -409,7 +409,7 @@ class PageTest extends PHPUnit_Framework_TestCase $currentPage->InitializeContent (); $this->assertEquals ("Tags", $currentPage->title); - $this->assertCount (10, $currentPage->entryArray); + $this->assertCount (11, $currentPage->entryArray); $this->assertEquals ("Action & Adventure", $currentPage->entryArray [0]->title); $this->assertFalse ($currentPage->ContainsBook ()); } @@ -441,8 +441,9 @@ class PageTest extends PHPUnit_Framework_TestCase $currentPage->InitializeContent (); $this->assertEquals ("Languages", $currentPage->title); - $this->assertCount (1, $currentPage->entryArray); + $this->assertCount (2, $currentPage->entryArray); $this->assertEquals ("English", $currentPage->entryArray [0]->title); + $this->assertEquals ("French", $currentPage->entryArray [1]->title); $this->assertFalse ($currentPage->ContainsBook ()); } @@ -505,8 +506,8 @@ class PageTest extends PHPUnit_Framework_TestCase $currentPage->InitializeContent (); $this->assertEquals ("Recent additions", $currentPage->title); - $this->assertCount (14, $currentPage->entryArray); - $this->assertEquals ("Alice's Adventures in Wonderland", $currentPage->entryArray [0]->title); + $this->assertCount (15, $currentPage->entryArray); + $this->assertEquals ("La curée", $currentPage->entryArray [0]->title); $this->assertTrue ($currentPage->ContainsBook ()); // Test facets @@ -525,8 +526,8 @@ class PageTest extends PHPUnit_Framework_TestCase $currentPage->InitializeContent (); $this->assertEquals ("Recent additions", $currentPage->title); - $this->assertCount (12, $currentPage->entryArray); - $this->assertEquals ("Alice's Adventures in Wonderland", $currentPage->entryArray [0]->title); + $this->assertCount (13, $currentPage->entryArray); + $this->assertEquals ("La curée", $currentPage->entryArray [0]->title); $this->assertTrue ($currentPage->ContainsBook ()); $_GET["tag"] = NULL;