function AdminNegotiatorTest::testDetermineActiveTheme

Same name in other branches
  1. 9 core/modules/user/tests/src/Unit/Theme/AdminNegotiatorTest.php \Drupal\Tests\user\Unit\Theme\AdminNegotiatorTest::testDetermineActiveTheme()
  2. 10 core/modules/user/tests/src/Unit/Theme/AdminNegotiatorTest.php \Drupal\Tests\user\Unit\Theme\AdminNegotiatorTest::testDetermineActiveTheme()
  3. 11.x core/modules/user/tests/src/Unit/Theme/AdminNegotiatorTest.php \Drupal\Tests\user\Unit\Theme\AdminNegotiatorTest::testDetermineActiveTheme()

@dataProvider getThemes

File

core/modules/user/tests/src/Unit/Theme/AdminNegotiatorTest.php, line 23

Class

AdminNegotiatorTest
Tests AdminNegotiator class.

Namespace

Drupal\Tests\user\Unit\Theme

Code

public function testDetermineActiveTheme($admin_theme, $expected) {
    $user = $this->prophesize(AccountInterface::class);
    $config_factory = $this->getConfigFactoryStub([
        'system.theme' => [
            'admin' => $admin_theme,
        ],
    ]);
    $entity_type_manager = $this->prophesize(EntityTypeManagerInterface::class);
    $admin_context = $this->prophesize(AdminContext::class);
    $negotiator = new AdminNegotiator($user->reveal(), $config_factory, $entity_type_manager->reveal(), $admin_context->reveal());
    $route_match = $this->prophesize(RouteMatch::class);
    $this->assertSame($expected, $negotiator->determineActiveTheme($route_match->reveal()));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.