public function DynamicRoutingTest::testDynamicRoutes in Bakery Single Sign-On System 8.2
Test that some routes are correctly registered.
This is sort of a lower gut check on things. Other tests need to validate the routes actually function.
File
- tests/
src/ Functional/ DynamicRoutingTest.php, line 28
Class
Namespace
Drupal\Tests\bakery\FunctionalCode
public function testDynamicRoutes() {
$router = $this->container
->get('router.route_provider');
$this
->config('bakery.settings')
->set('bakery_is_master', 1)
->set('subsite_login', TRUE)
->save();
$this->container
->get('router.builder')
->rebuild();
$this->routeProvider
->reset();
$this
->assertRouteExists('bakery.register');
$this
->assertRouteExists('bakery.login');
$this
->assertRouteExists('bakery.create');
$this
->config('bakery.settings')
->set('bakery_is_master', 1)
->set('subsite_login', FALSE)
->save();
$this->container
->get('router.builder')
->rebuild();
$this->routeProvider
->reset();
$this
->assertRouteNotExists('bakery.register');
$this
->assertRouteNotExists('bakery.login');
$this
->assertRouteExists('bakery.create');
$this
->config('bakery.settings')
->set('bakery_is_master', 0)
->set('subsite_login', TRUE)
->save();
$this->container
->get('router.builder')
->rebuild();
$this->routeProvider
->reset();
$this
->assertRouteExists('bakery.register');
$this
->assertRouteExists('bakery.create');
$this
->assertRouteExists('bakery.update');
$this
->assertRouteExists('bakery.repair');
$this
->assertRouteExists('bakery.pull');
$this
->config('bakery.settings')
->set('bakery_is_master', 0)
->set('subsite_login', FALSE)
->save();
$this->container
->get('router.builder')
->rebuild();
$router
->reset();
$this->routeProvider
->reset();
$this
->assertRouteNotExists('bakery.register');
$this
->assertRouteNotExists('bakery.create');
$this
->assertRouteExists('bakery.update');
$this
->assertRouteExists('bakery.repair');
$this
->assertRouteExists('bakery.pull');
}