public function UserBlockTest::testBlockUserWithBlockedAuthenticatedUser in Rules 8.3
Test execute() method for blocked and authenticated users.
@covers ::execute
File
- tests/
src/ Unit/ Integration/ RulesAction/ UserBlockTest.php, line 115
Class
- UserBlockTest
- @coversDefaultClass \Drupal\rules\Plugin\RulesAction\UserBlock @group RulesAction
Namespace
Drupal\Tests\rules\Unit\Integration\RulesActionCode
public function testBlockUserWithBlockedAuthenticatedUser() {
$user = $this
->getUserMock(self::BLOCKED, self::AUTHENTICATED);
$user
->block()
->shouldNotBeCalled();
$this->sessionManager
->delete()
->shouldNotBeCalled();
$this->action
->setContextValue('user', $user
->reveal());
$this->action
->execute();
$this
->assertEquals($this->action
->autoSaveContext(), [], 'Action returns nothing for auto saving since the user has not been altered.');
}