summaryrefslogtreecommitdiff
path: root/tests/Unit/Helpers/Stub
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Unit/Helpers/Stub')
-rw-r--r--tests/Unit/Helpers/Stub/UserModelImplementation.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/Unit/Helpers/Stub/UserModelImplementation.php b/tests/Unit/Helpers/Stub/UserModelImplementation.php
new file mode 100644
index 00000000..934aaeb2
--- /dev/null
+++ b/tests/Unit/Helpers/Stub/UserModelImplementation.php
@@ -0,0 +1,29 @@
+<?php
+
+namespace Engelsystem\Test\Unit\Helpers\Stub;
+
+use Engelsystem\Models\User\User;
+use InvalidArgumentException;
+
+class UserModelImplementation extends User
+{
+ /** @var User */
+ public static $user = null;
+
+ /** @var int */
+ public static $id = null;
+
+ /**
+ * @param mixed $id
+ * @param array $columns
+ * @return User|null
+ */
+ public static function find($id, $columns = ['*'])
+ {
+ if ($id != static::$id) {
+ throw new InvalidArgumentException('Wrong user ID searched');
+ }
+
+ return self::$user;
+ }
+}