RolebasedTest.php in Role Based Theme Switcher 9.1.x
File
tests/src/Unit/RolebasedTest.php
View source
<?php
namespace Drupal\Tests\role_based_theme_switcher\Unit;
use Drupal\Tests\UnitTestCase;
class RolebasedTest extends UnitTestCase {
public function setUp() {
parent::setUp();
}
public function testStub() {
$role = [
'authenticated',
'administrator',
];
$stub = $this
->getMockBuilder('Drupal\\role_based_theme_switcher\\Theme\\RoleNegotiator')
->disableOriginalConstructor()
->setMethods([
'getPriorityRole',
])
->getMock();
$stub
->expects($this
->once())
->method('getPriorityRole')
->with($this
->equalTo($role));
$stub
->getPriorityRole($role);
}
}