From 814f99d4711816c346d2df3761c7c4d2f86cd775 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Sat, 21 Jan 2012 12:38:17 +0100 Subject: Fix bug #3111254: getIdFromUser() always returns an integer now (part 2) --- doc/ChangeLog | 1 + src/SemanticScuttle/Model/User.php | 2 +- tests/UserTest.php | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 6a08fea..a8c3e12 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -19,6 +19,7 @@ ChangeLog for SemantiScuttle - Fix bug #3413459: Thumbnails not in one line - Fix bug #3468293: Delicious import does not preserve private links - Fix bug #3396727: Title of http://lesscss.org/ not loaded +- Fix bug #3111254: getIdFromUser() always returns an integer now (part 2) - Implement request #3403609: fr_CA translation update - Implement patch #3476011: PostgreSQL tables can not be initialized (Frédéric Fauberteau [triaxx]) diff --git a/src/SemanticScuttle/Model/User.php b/src/SemanticScuttle/Model/User.php index 3aa617b..e5d29af 100644 --- a/src/SemanticScuttle/Model/User.php +++ b/src/SemanticScuttle/Model/User.php @@ -56,7 +56,7 @@ class SemanticScuttle_Model_User */ public function getId() { - return $this->id; + return (int)$this->id; } /** diff --git a/tests/UserTest.php b/tests/UserTest.php index 6cd6786..85d2204 100644 --- a/tests/UserTest.php +++ b/tests/UserTest.php @@ -246,6 +246,22 @@ class UserTest extends TestBase ); } + public function testGetIdFromUserParamId() + { + $uid = $this->addUser(); + $newId = $this->us->getIdFromUser($uid); + $this->assertInternalType('integer', $newId); + $this->assertEquals($uid, $newId); + } + + public function testGetIdFromUserParamUsername() + { + $uid = $this->addUser('someusername'); + $newId = $this->us->getIdFromUser('someusername'); + $this->assertInternalType('integer', $newId); + $this->assertEquals($uid, $newId); + } + /** -- cgit v1.2.3