Altered tests to be more timezone friendly
This commit is contained in:
parent
b105867e75
commit
342d1c3205
@ -486,7 +486,7 @@ class SemanticScuttle_Service_Bookmark extends SemanticScuttle_DbService
|
|||||||
} else {
|
} else {
|
||||||
$time = strtotime($date);
|
$time = strtotime($date);
|
||||||
}
|
}
|
||||||
$datetime = gmdate('Y-m-d H:i:s', $time);
|
$datetime = date('Y-m-d H:i:s', $time);
|
||||||
|
|
||||||
if ($short === '') {
|
if ($short === '') {
|
||||||
$short = null;
|
$short = null;
|
||||||
|
@ -111,7 +111,7 @@ TXT;
|
|||||||
$this->assertEquals($bmDescription, stripslashes($bm['bDescription']));
|
$this->assertEquals($bmDescription, stripslashes($bm['bDescription']));
|
||||||
$this->assertEquals($bmTags, $bm['tags']);
|
$this->assertEquals($bmTags, $bm['tags']);
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
gmdate('Y-m-d H:i:s', strtotime($bmDatetime)),
|
date('Y-m-d H:i:s', strtotime($bmDatetime)),
|
||||||
$bm['bDatetime']
|
$bm['bDatetime']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -173,7 +173,7 @@ TXT;
|
|||||||
$this->assertEquals($bmDescription, stripslashes($bm['bDescription']));
|
$this->assertEquals($bmDescription, stripslashes($bm['bDescription']));
|
||||||
$this->assertEquals($bmTags, $bm['tags']);
|
$this->assertEquals($bmTags, $bm['tags']);
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
gmdate('Y-m-d H:i:s', strtotime($bmDatetime)),
|
date('Y-m-d H:i:s', strtotime($bmDatetime)),
|
||||||
$bm['bDatetime']
|
$bm['bDatetime']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -282,16 +282,16 @@ class Bookmark2TagTest extends TestBase
|
|||||||
public function testGetPopularTagsDays()
|
public function testGetPopularTagsDays()
|
||||||
{
|
{
|
||||||
$user = $this->addUser();
|
$user = $this->addUser();
|
||||||
$this->addTagBookmark($user, array('one', 'two'), 'today');
|
$this->addTagBookmark($user, array('one', 'two'), 'now');
|
||||||
$this->addTagBookmark($user, array('one', 'thr'), 'today');
|
$this->addTagBookmark($user, array('one', 'thr'), 'now');
|
||||||
$this->addTagBookmark($user, array('one', 'two'), '-1 day 1 hour');
|
$this->addTagBookmark($user, array('one', 'two'), '-1 day -1 hour');
|
||||||
$this->addTagBookmark($user, array('one', 'thr'), '-3 days 1 hour');
|
$this->addTagBookmark($user, array('one', 'thr'), '-3 days -1 hour');
|
||||||
|
|
||||||
$arTags = $this->b2ts->getPopularTags(null, 10, null, 1);
|
$arTags = $this->b2ts->getPopularTags(null, 10, null, 1);
|
||||||
$this->assertInternalType('array', $arTags);
|
$this->assertInternalType('array', $arTags);
|
||||||
$this->assertEquals(3, count($arTags));
|
$this->assertEquals(3, count($arTags));
|
||||||
$this->assertContains(array('tag' => 'one', 'bCount' => '3'), $arTags);
|
$this->assertContains(array('tag' => 'one', 'bCount' => '2'), $arTags);
|
||||||
$this->assertContains(array('tag' => 'two', 'bCount' => '2'), $arTags);
|
$this->assertContains(array('tag' => 'two', 'bCount' => '1'), $arTags);
|
||||||
$this->assertContains(array('tag' => 'thr', 'bCount' => '1'), $arTags);
|
$this->assertContains(array('tag' => 'thr', 'bCount' => '1'), $arTags);
|
||||||
|
|
||||||
$arTags = $this->b2ts->getPopularTags(null, 10, null, 2);
|
$arTags = $this->b2ts->getPopularTags(null, 10, null, 2);
|
||||||
|
Loading…
Reference in New Issue
Block a user