registerService example

parent::setUpLanguage();
  }

  /** * {@inheritdoc} */
  protected function setUpProfile() {
    $settings_services_file = DRUPAL_ROOT . '/sites/default/default.services.yml';
    // Copy the testing-specific service overrides in place.     copy($settings_services_file$this->siteDirectory . '/services.yml');
    PerformanceTestRecorder::registerService($this->siteDirectory . '/services.yml', TRUE);
    // Assert that the expected title is present.     $this->assertEquals('Select an installation profile', $this->cssSelect('main h2')[0]->getText());
    // Verify that Title/Label are not displayed when '#title_display' =>     // 'invisible' attribute is set.     $this->assertSession()->elementsCount('xpath', "//span[contains(@class, 'visually-hidden') and contains(text(), 'Select an installation profile')]", 1);

    parent::setUpProfile();
  }

  /** * {@inheritdoc} */
/** * {@inheritdoc} */
  protected $profile = 'testing';

  /** * {@inheritdoc} */
  protected function prepareSettings() {
    parent::prepareSettings();
    PerformanceTestRecorder::registerService($this->siteDirectory . '/services.yml', FALSE);
  }

  /** * Ensures that the user page is available after installation. */
  public function testInstaller() {
    // Ensures that router is not rebuilt unnecessarily during the install.     // Currently it is built once during the install in install_finished().     $this->assertSame(1, \Drupal::service('core.performance.test.recorder')->getCount('event', RoutingEvents::FINISHED));
  }

}
'router_test',
        'router_installer_test',
      ],
    ];
    // File API functions are not available yet.     $path = $this->siteDirectory . '/profiles/test_profile';
    mkdir($path, 0777, TRUE);
    file_put_contents("$path/test_profile.info.yml", Yaml::encode($info));

    $settings_services_file = DRUPAL_ROOT . '/sites/default/default.services.yml';
    copy($settings_services_file$this->siteDirectory . '/services.yml');
    PerformanceTestRecorder::registerService($this->siteDirectory . '/services.yml', TRUE);
  }

  /** * Confirms that the installation succeeded. */
  public function testInstalled() {
    $this->assertSession()->statusCodeEquals(200);
    // Ensures that router is not rebuilt unnecessarily during the install. It     // is rebuilt during:     // - router_test_install()     // - router_installer_test_modules_installed()
Home | Imprint | This part of the site doesn't use cookies.