opensupports/server/tests/__mocks__/UserMock.php

29 lines
826 B
PHP
Raw Normal View History

<?php
class User extends \Mock {
public static $functionList = array();
public static function initStubs() {
parent::setStatics(array(
'authenticate' => parent::stub()->returns(self::getUserInstanceMock()),
2017-01-15 03:51:31 +01:00
'getDataStore' => parent::stub()->returns(self::getUserInstanceMock())
));
}
2018-10-05 07:28:57 +02:00
public function isNull() {
return false;
}
private static function getUserInstanceMock() {
$mockUserInstance = new User();
$mockUserInstance->id = 'MOCK_ID';
$mockUserInstance->email = 'MOCK_EMAIL';
$mockUserInstance->password = 'MOCK_PASSWORD';
2018-10-05 07:28:57 +02:00
$mockUserInstance->disabled = 0;
$mockUserInstance->lastLogin = '20180101';
2017-01-15 03:51:31 +01:00
$mockUserInstance->verificationToken = null;
return $mockUserInstance;
}
2018-10-05 07:28:57 +02:00
}