protected function AgreementSubscriberTest::getAccountStub in Agreement 3.0.x
Same name and namespace in other branches
- 8.2 tests/src/Unit/EventSubscriber/AgreementSubscriberTest.php \Drupal\Tests\agreement\Unit\EventSubscriber\AgreementSubscriberTest::getAccountStub()
Get the mocked current user account object.
Parameters
bool $canBypass: Can the user bypass agreement.
Return value
object The mocked user account object.
1 call to AgreementSubscriberTest::getAccountStub()
- AgreementSubscriberTest::testCheckForRedirection in tests/
src/ Unit/ EventSubscriber/ AgreementSubscriberTest.php - Asserts that check for redirection method is functional.
File
- tests/
src/ Unit/ EventSubscriber/ AgreementSubscriberTest.php, line 70
Class
- AgreementSubscriberTest
- Tests the agreement route subscriber.
Namespace
Drupal\Tests\agreement\Unit\EventSubscriberCode
protected function getAccountStub($canBypass = FALSE) {
$accountProphet = $this
->prophesize('\\Drupal\\Core\\Session\\AccountProxyInterface');
$accountProphet
->hasPermission('bypass agreement')
->willReturn($canBypass);
return $accountProphet
->reveal();
}