2014-05-12 20:10:19 +02:00
|
|
|
<?php
|
|
|
|
class AcceptUserRegistrationJobTest extends AbstractTest
|
|
|
|
{
|
|
|
|
public function testConfirming()
|
|
|
|
{
|
|
|
|
$this->grantAccess('acceptUserRegistration');
|
|
|
|
|
2014-05-13 21:08:07 +02:00
|
|
|
$user = $this->userMocker->mockSingle();
|
2014-06-13 12:01:19 +02:00
|
|
|
$this->assert->isNull($user->isStaffConfirmed());
|
2014-05-12 20:10:19 +02:00
|
|
|
|
|
|
|
$user = $this->assert->doesNotThrow(function() use ($user)
|
|
|
|
{
|
|
|
|
return Api::run(
|
|
|
|
new AcceptUserRegistrationJob(),
|
|
|
|
[
|
|
|
|
JobArgs::ARG_USER_NAME => $user->getName(),
|
|
|
|
]);
|
|
|
|
});
|
|
|
|
|
|
|
|
$this->assert->isTrue($user->isStaffConfirmed());
|
|
|
|
}
|
|
|
|
}
|