summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Auth/OpenID/FileStore.php2
-rw-r--r--Tests/Auth/OpenID/StoreTest.php26
2 files changed, 27 insertions, 1 deletions
diff --git a/Auth/OpenID/FileStore.php b/Auth/OpenID/FileStore.php
index 0cc682d..6ce8856 100644
--- a/Auth/OpenID/FileStore.php
+++ b/Auth/OpenID/FileStore.php
@@ -328,7 +328,7 @@ class Auth_OpenID_FileStore extends Auth_OpenID_OpenIDStore {
// strip off the path to do the comparison
$name = basename($filename);
foreach ($association_files as $association_file) {
- if (strpos($association_file, $name) == 0) {
+ if (strpos($association_file, $name) === 0) {
$matching_files[] = $association_file;
}
}
diff --git a/Tests/Auth/OpenID/StoreTest.php b/Tests/Auth/OpenID/StoreTest.php
index 5a90e14..4487b17 100644
--- a/Tests/Auth/OpenID/StoreTest.php
+++ b/Tests/Auth/OpenID/StoreTest.php
@@ -268,6 +268,32 @@ explicitly');
$this->_checkRemove($store, $server_url, $assoc3->handle,
false, "(25)");
+
+ // Put associations into store, for two different server URLs
+ $assoc1 = $this->genAssoc($now);
+ $assoc2 = $this->genAssoc($now + 2);
+ $server_url1 = "http://one.example.com/one";
+ $server_url2 = "http://two.localhost.localdomain/two";
+
+ $store->storeAssociation($server_url1, $assoc1);
+ $store->storeAssociation($server_url2, $assoc2);
+
+ // Ask for each one, make sure we get it
+ $this->_checkRetrieve($store, $server_url1, $assoc1->handle,
+ $assoc1, "(26)");
+
+ $this->_checkRetrieve($store, $server_url2, $assoc2->handle,
+ $assoc2, "(27)");
+
+ $store->storeAssociation($server_url1, $assoc1);
+ $store->storeAssociation($server_url2, $assoc2);
+
+ // Ask for each one, make sure we get it
+ $this->_checkRetrieve($store, $server_url1, null,
+ $assoc1, "(28)");
+
+ $this->_checkRetrieve($store, $server_url2, null,
+ $assoc2, "(29)");
}
function _checkUseNonce(&$store, $nonce, $expected, $msg=null)