summaryrefslogtreecommitdiffstats
path: root/tests/Psecio/Gatekeeper/SecurityQuestionCollectionTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Psecio/Gatekeeper/SecurityQuestionCollectionTest.php')
-rw-r--r--tests/Psecio/Gatekeeper/SecurityQuestionCollectionTest.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/Psecio/Gatekeeper/SecurityQuestionCollectionTest.php b/tests/Psecio/Gatekeeper/SecurityQuestionCollectionTest.php
new file mode 100644
index 0000000..6ea2ccd
--- /dev/null
+++ b/tests/Psecio/Gatekeeper/SecurityQuestionCollectionTest.php
@@ -0,0 +1,24 @@
+<?php
+
+namespace Psecio\Gatekeeper;
+
+class SecurityQuestionCollectionTest extends \Psecio\Gatekeeper\Base
+{
+ /**
+ * Test the location of security questions of a user by ID
+ */
+ public function testFindQuestionsByUserId()
+ {
+ $userId = 1;
+ $return = [
+ ['question' => 'Arthur', 'answer' => 'Dent', 'user_id' => $userId],
+ ['name' => 'Ford', 'description' => 'Prefect', 'user_id' => $userId]
+ ];
+
+ $ds = $this->buildMock($return, 'fetch');
+ $questions = new SecurityQuestionCollection($ds);
+
+ $questions->findByUserId($userId);
+ $this->assertCount(2, $questions);
+ }
+} \ No newline at end of file