aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
+ }
+
/**