summaryrefslogtreecommitdiff
path: root/tests/Unit/Helpers/Stub/UserModelImplementation.php
blob: 934aaeb2ff1523aba444d3f658868d4aa9d06bcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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;
    }
}