summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Net/OpenID/Consumer/Consumer.php8
-rw-r--r--Tests/Net/OpenID/Consumer.php4
2 files changed, 9 insertions, 3 deletions
diff --git a/Net/OpenID/Consumer/Consumer.php b/Net/OpenID/Consumer/Consumer.php
index 7ad1419..0fbe335 100644
--- a/Net/OpenID/Consumer/Consumer.php
+++ b/Net/OpenID/Consumer/Consumer.php
@@ -42,7 +42,13 @@ $_Net_OpenID_NONCE_LEN = 8;
class Net_OpenID_Consumer {
- function Net_OpenID_Consumer(&$store, &$fetcher, $immediate = false)
+ /**
+ * NOTE: Be sure to pass $fetcher by reference if you pass one at
+ * all:
+ *
+ * $consumer = new Net_OpenID_Consumer($store, &$fetcher, ...);
+ */
+ function Net_OpenID_Consumer(&$store, $fetcher = null, $immediate = false)
{
if ($store === null) {
trigger_error("Must supply non-null store to create consumer",
diff --git a/Tests/Net/OpenID/Consumer.php b/Tests/Net/OpenID/Consumer.php
index 3d23794..5937143 100644
--- a/Tests/Net/OpenID/Consumer.php
+++ b/Tests/Net/OpenID/Consumer.php
@@ -198,7 +198,7 @@ class Tests_Net_OpenID_Consumer extends PHPUnit_TestCase {
$_Net_OpenID_assocs[0][0],
$_Net_OpenID_assocs[0][1]);
- $consumer = new Net_OpenID_Consumer($store, $fetcher, $immediate);
+ $consumer = new Net_OpenID_Consumer($store, &$fetcher, $immediate);
$this->assertEquals($fetcher->num_assocs, 0);
$this->_run($consumer, $user_url, $mode, $delegate_url,
@@ -258,7 +258,7 @@ class Tests_Net_OpenID_Consumer extends PHPUnit_TestCase {
Net_OpenID_mkdtemp($_Net_OpenID_filestore_base_dir));
$fetcher = new Net_OpenID_TestFetcher(null, null, null, null);
- $consumer = new Net_OpenID_Consumer($store, $fetcher);
+ $consumer = new Net_OpenID_Consumer($store, &$fetcher);
$cases = array(
array(null, 'http://network.error/'),
array(404, 'http://not.found/'),