From 25ae541840ea87db649302a0689e2fd896b19a01 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 21 Mar 2013 18:23:34 +0100 Subject: fix timing bug in tests by using title sort order instead of date sort, fix bug when no user was in db --- tests/Tag2TagTest.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/Tag2TagTest.php b/tests/Tag2TagTest.php index d7dd8b7..89da483 100644 --- a/tests/Tag2TagTest.php +++ b/tests/Tag2TagTest.php @@ -35,6 +35,8 @@ class Tag2TagTest extends TestBase protected function setUp() { $this->us =SemanticScuttle_Service_Factory::get('User'); + $this->us->deleteAll(); + $this->addUser(); $this->bs =SemanticScuttle_Service_Factory::get('Bookmark'); $this->bs->deleteAll(); $this->b2ts =SemanticScuttle_Service_Factory::get('Bookmark2Tag'); @@ -318,20 +320,20 @@ class Tag2TagTest extends TestBase $this->assertSame('B1', $results['bookmarks'][0]['bTitle']); //advanced queries - $results = $bs->getBookmarks(0, NULL, 1, 'aa'); + $results = $bs->getBookmarks(0, NULL, 1, 'aa', null, 'title_asc'); $this->assertSame(2, intval($results['total'])); $this->assertSame('B1', $results['bookmarks'][0]['bTitle']); $this->assertSame('B2', $results['bookmarks'][1]['bTitle']); - $results = $bs->getBookmarks(0, NULL, 1, 'ee'); + $results = $bs->getBookmarks(0, NULL, 1, 'ee', null, 'title_asc'); $this->assertSame(2, intval($results['total'])); - $this->assertSame('B2', $results['bookmarks'][1]['bTitle']); - $this->assertSame('B3', $results['bookmarks'][0]['bTitle']); + $this->assertSame('B2', $results['bookmarks'][0]['bTitle']); + $this->assertSame('B3', $results['bookmarks'][1]['bTitle']); - $results = $bs->getBookmarks(0, NULL, 1, 'ii'); + $results = $bs->getBookmarks(0, NULL, 1, 'ii', null, 'title_asc'); $this->assertSame(2, intval($results['total'])); - $this->assertSame('B2', $results['bookmarks'][1]['bTitle']); - $this->assertSame('B3', $results['bookmarks'][0]['bTitle']); + $this->assertSame('B2', $results['bookmarks'][0]['bTitle']); + $this->assertSame('B3', $results['bookmarks'][1]['bTitle']); $results = $bs->getBookmarks(0, NULL, 1, 'aa+ee'); -- cgit v1.2.3