create test users individually

This commit is contained in:
Shish 2020-01-27 13:00:09 +00:00
parent 88b592c6ef
commit 5dab234630

View file

@ -10,12 +10,17 @@ $_SERVER['QUERY_STRING'] = '/';
chdir(dirname(dirname(__FILE__)));
require_once "core/_bootstrap.php";
if (is_null(User::by_name("demo"))) {
$userPage = new UserPage();
$userPage->onUserCreation(new UserCreationEvent("demo", "demo", ""));
$userPage->onUserCreation(new UserCreationEvent("test", "test", ""));
function create_user(string $name) {
if (is_null(User::by_name($name))) {
$userPage = new UserPage();
$userPage->onUserCreation(new UserCreationEvent($name, $name, ""));
assert(!is_null(User::by_name($name)), "Creation of user $name failed");
}
}
create_user("demo");
create_user("test");
abstract class ShimmiePHPUnitTestCase extends \PHPUnit\Framework\TestCase
{
private $images = [];