Fix number of elements in authors lists. re #79

This commit is contained in:
Sébastien Lucas 2014-06-01 22:11:14 +02:00
parent 734946e826
commit 86999dd3ec
2 ha cambiato i file con 6 aggiunte e 2 eliminazioni

Vedi File

@ -53,7 +53,7 @@ order by substr (upper (sort), 1, 1)", "substr (upper (sort), 1, 1) as title, co
{
array_push ($entryArray, new Entry ($post->title, Author::getEntryIdByLetter ($post->title),
str_format (localize("authorword", $post->count), $post->count), "text",
array ( new LinkNavigation ("?page=".parent::PAGE_AUTHORS_FIRST_LETTER."&id=". rawurlencode ($post->title)))));
array ( new LinkNavigation ("?page=".parent::PAGE_AUTHORS_FIRST_LETTER."&id=". rawurlencode ($post->title))), "", $post->count));
}
return $entryArray;
}
@ -78,7 +78,7 @@ order by substr (upper (sort), 1, 1)", "substr (upper (sort), 1, 1) as title, co
$author = new Author ($post->id, $post->name, $post->sort);
array_push ($entryArray, new Entry ($post->sort, $author->getEntryId (),
str_format (localize("bookword", $post->count), $post->count), "text",
array ( new LinkNavigation ($author->getUri ()))));
array ( new LinkNavigation ($author->getUri ())), "", $post->count));
}
return $entryArray;
}

Vedi File

@ -91,6 +91,7 @@ class PageTest extends PHPUnit_Framework_TestCase
$this->assertCount (9, $currentPage->entryArray);
$this->assertEquals ("Type1", $currentPage->entryArray [6]->title);
$this->assertEquals ("Alphabetical index of the 2 tags", $currentPage->entryArray [6]->content);
$this->assertEquals (2, $currentPage->entryArray [6]->numberOfElement);
$config['cops_calibre_custom_column'] = array ("type2");
@ -100,6 +101,7 @@ class PageTest extends PHPUnit_Framework_TestCase
$this->assertCount (9, $currentPage->entryArray);
$this->assertEquals ("Type2", $currentPage->entryArray [6]->title);
$this->assertEquals ("Alphabetical index of the 3 tags", $currentPage->entryArray [6]->content);
$this->assertEquals (3, $currentPage->entryArray [6]->numberOfElement);
$config['cops_calibre_custom_column'] = array ("type4");
@ -109,6 +111,7 @@ class PageTest extends PHPUnit_Framework_TestCase
$this->assertCount (9, $currentPage->entryArray);
$this->assertEquals ("Type4", $currentPage->entryArray [6]->title);
$this->assertEquals ("Alphabetical index of the 2 tags", $currentPage->entryArray [6]->content);
$this->assertEquals (2, $currentPage->entryArray [6]->numberOfElement);
$config['cops_calibre_custom_column'] = array ("type1", "type2", "type4");
@ -236,6 +239,7 @@ class PageTest extends PHPUnit_Framework_TestCase
$this->assertEquals ("Authors", $currentPage->title);
$this->assertCount (5, $currentPage->entryArray);
$this->assertEquals ("C", $currentPage->entryArray [0]->title);
$this->assertEquals (1, $currentPage->entryArray [0]->numberOfElement);
$this->assertFalse ($currentPage->ContainsBook ());
}