Fix bug #3073215: Updating bookmark time does not work

git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@745 b3834d28-1941-0410-a4f8-b48e95affb8f
This commit is contained in:
cweiske 2010-09-23 07:34:05 +00:00
parent ea4c9fa4f7
commit b17e8f940c
3 changed files with 34 additions and 1 deletions

View file

@ -6,6 +6,7 @@ ChangeLog for SemantiScuttle
- Fix bug getTagsForBookmarks() that fetched all tags
- Show error message on mysqli connection errors
- Implement patch #3059829: update FR_CA translation
- Fix bug #3073215: Updating bookmark time does not work
0.97.0 - 2010-06-09

View file

@ -611,7 +611,7 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
if (!is_null($date)) {
$datetime = gmdate('Y-m-d H:i:s', strtotime($date));
$updates[] = array('bDateTime' => $datetime);
$updates['bDatetime'] = $datetime;
}
$sql = 'UPDATE '. $GLOBALS['tableprefix'] .'bookmarks SET '. $this->db->sql_build_array('UPDATE', $updates) .' WHERE bId = '. intval($bId);

View file

@ -982,6 +982,38 @@ class BookmarkTest extends TestBase
$this->assertEquals('newShortNambb', $bm['bShort']);
}
/**
* Tests if updating a bookmark's date works.
* This once was a bug, see bug #3073215.
*
* @return void
*
* @link https://sourceforge.net/tracker/?func=detail&atid=1017430&aid=3073215&group_id=211356
*/
public function testUpdateBookmarkDate()
{
$bid = $this->bs->addBookmark(
'http://example.org', 'title', 'desc', 'priv',
0, array(), 'myShortName'
);
$bm = $this->bs->getBookmark($bid);
$this->assertEquals('myShortName', $bm['bShort']);
$this->assertTrue(
$this->bs->updateBookmark(
$bid, 'http://example2.org', 'my title', 'desc',
'priv', 0, array(), 'newShortNambb',
//we need to use zulu (GMT) time zone here
// since the dates/times are stored as that
// in the database
'2002-03-04T05:06:07Z'
)
);
$bm = $this->bs->getBookmark($bid);
$this->assertEquals('newShortNambb', $bm['bShort']);
$this->assertEquals('2002-03-04 05:06:07', $bm['bDatetime']);
}
/**