summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2012-01-21 12:38:17 +0100
committerChristian Weiske <cweiske@cweiske.de>2012-01-21 12:38:17 +0100
commit814f99d4711816c346d2df3761c7c4d2f86cd775 (patch)
tree1ae4795e710821afa8d0087fe03437a53496e26d
parentdf00540d4c2d5c03352d1e79e526ccd6f7cbcd9f (diff)
downloadsemanticscuttle-814f99d4711816c346d2df3761c7c4d2f86cd775.tar.gz
semanticscuttle-814f99d4711816c346d2df3761c7c4d2f86cd775.tar.bz2
Fix bug #3111254: getIdFromUser() always returns an integer now (part 2)
-rw-r--r--doc/ChangeLog1
-rw-r--r--src/SemanticScuttle/Model/User.php2
-rw-r--r--tests/UserTest.php16
3 files changed, 18 insertions, 1 deletions
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);
+ }
+
/**