Tests \Drupal\Core\EventSubscriber\SlaveDatabaseIgnoreSubscriber::checkSlaveServer().
function testSystemInitIgnoresSlaves() {
  // Clone the master credentials to a slave connection.
  // Note this will result in two independent connection objects that happen
  // to point to the same place.
  $connection_info = Database::getConnectionInfo('default');
  Database::addConnectionInfo('default', 'slave', $connection_info['default']);
  db_ignore_slave();
  $kernel = new DrupalKernel('testing', FALSE, drupal_classloader(), FALSE);
  $event = new GetResponseEvent($kernel, Request::create('http://example.com'), HttpKernelInterface::MASTER_REQUEST);
  $subscriber = new SlaveDatabaseIgnoreSubscriber();
  $subscriber
    ->checkSlaveServer($event);
  $db1 = Database::getConnection('default', 'default');
  $db2 = Database::getConnection('slave', 'default');
  $this
    ->assertIdentical($db1, $db2, 'System Init ignores slaves when requested.');
}