/**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->drupalLogin($this->createAdminUser());
     $this->setupEntityDisplays();
     $this->manageDisplay = 'admin/structure/types/manage/test_content_type_name/display/teaser';
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->cookies = new CookieJar();
     $encoders = [new JsonEncoder(), new XmlEncoder()];
     $this->serializer = new Serializer([], $encoders);
 }
Example #3
0
 protected function setUp()
 {
     parent::setUp();
     // Create users.
     $this->adminUser = $this->drupalCreateUser(array('access administration pages', 'view the administration theme', 'administer permissions'));
     $this->anyUser = $this->drupalCreateUser(array());
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     \Drupal::service('theme_handler')->install(array('bartik'));
     // Create user.
     $this->adminUser = $this->drupalCreateUser(array('administer themes'));
     $this->drupalLogin($this->adminUser);
 }
Example #5
0
 /**
  * {@inheritdoc}
  */
 public function setUp()
 {
     parent::setUp();
     $this->createContentType(['type' => 'page']);
     $this->createNode(['title' => 'Alpha']);
     $this->createNode(['title' => 'Beta']);
     $this->createNode(['title' => 'Gamma']);
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     EnhancedEntityBundle::create(['id' => 'default', 'label' => 'Default'])->save();
     $this->placeBlock('local_tasks_block');
     $this->placeBlock('system_breadcrumb_block');
     $this->account = $this->drupalCreateUser(['administer entity_test_enhanced', 'view all entity_test_enhanced revisions']);
     $this->drupalLogin($this->account);
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $node_type = NodeType::create(['type' => 'article', 'name' => t('Article')]);
     $node_type->save();
     $this->nodeAuthor = $this->drupalCreateUser(['create article content', 'skip comment approval', 'post comments', 'edit own comments', 'access comments', 'administer nodes']);
     $this->commentAdmin = $this->drupalCreateUser(['administer comments', 'create article content', 'edit own comments', 'skip comment approval', 'post comments', 'access comments', 'administer nodes']);
     $this->addDefaultCommentField('node', 'article');
 }
 /**
  * {@inheritdoc}
  */
 protected function initMink()
 {
     $this->minkDefaultDriverArgs = ['firefox', NULL, 'http://127.0.0.1:4444/wd/hub'];
     try {
         return BrowserTestBase::initMink();
     } catch (Exception $e) {
         $this->markTestSkipped('An unexpected error occurred while starting Mink: ' . $e->getMessage());
     }
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->drupalLogin($this->createAdminUser());
     $this->drupalGet('admin/config/content/formats/manage/plain_text');
     // Setup the filter to have an editor.
     $this->getSession()->getPage()->find('css', '[name="editor[editor]"]')->setValue('ckeditor');
     $this->getSession()->getPage()->find('css', 'input[name="editor_configure"]')->click();
     $this->submitForm([], t('Save configuration'));
 }
Example #10
0
 /**
  * {@inheritdoc}
  */
 protected function initMink()
 {
     // Set up the template cache used by the PhantomJS mink driver.
     $path = $this->tempFilesDirectory . DIRECTORY_SEPARATOR . 'browsertestbase-templatecache';
     $this->minkDefaultDriverArgs = ['http://127.0.0.1:8510', $path];
     if (!file_exists($path)) {
         mkdir($path);
     }
     return parent::initMink();
 }
Example #11
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     // Create user.
     $this->bigUser = $this->drupalCreateUser(array('administer themes'));
     // This tests the color module in Bartik.
     $this->themes = array('bartik' => array('palette_input' => 'palette[bg]', 'scheme' => 'slate', 'scheme_color' => '#3b3b3b'), 'color_test_theme' => array('palette_input' => 'palette[bg]', 'scheme' => 'custom', 'scheme_color' => '#3b3b3b'));
     \Drupal::service('theme_handler')->install(array_keys($this->themes));
     // Array filled with valid and not valid color values.
     $this->colorTests = array('#000' => TRUE, '#123456' => TRUE, '#abcdef' => TRUE, '#0' => FALSE, '#00' => FALSE, '#0000' => FALSE, '#00000' => FALSE, '123456' => FALSE, '#00000g' => FALSE);
 }
Example #12
0
 /**
  * {@inheritdoc}
  */
 protected function tearDown()
 {
     // Wait for all requests to finish. It is possible that an AJAX request is
     // still on-going.
     $result = $this->getSession()->wait(5000, '(typeof(jQuery)=="undefined" || (0 === jQuery.active && 0 === jQuery(\':animated\').length))');
     if (!$result) {
         // If the wait is unsuccessful, there may still be an AJAX request in
         // progress. If we tear down now, then this AJAX request may fail with
         // missing database tables, because tear down will have removed them. Rather
         // than allow it to fail, throw an explicit exception now explaining what
         // the problem is.
         throw new \RuntimeException('Unfinished AJAX requests whilst tearing down a test');
     }
     parent::tearDown();
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     /** @var \Drupal\Core\Extension\ModuleHandlerInterface $module_handler */
     $module_handler = $this->container->get('module_handler');
     /** @var \Drupal\Core\Config\ConfigFactoryInterface $config_factory */
     $config_factory = $this->container->get('config.factory');
     // Set up the remote library definition URL to point to the local website.
     $base_url = getenv('SIMPLETEST_BASE_URL');
     $module_path = $module_handler->getModule('libraries')->getPath();
     $url = "{$base_url}/{$module_path}/tests/library_definitions";
     $config_factory->getEditable('libraries.settings')->set('definition.remote.url', $url)->save();
     // LibrariesConfigSubscriber::onConfigSave() invalidates the container so
     // that it is rebuilt on the next request. We need the container rebuilt
     // immediately, however.
     $this->rebuildContainer();
     $this->discovery = $this->container->get('libraries.definition.discovery');
     $this->localDiscovery = $this->container->get('libraries.definition.discovery.local');
     $this->remoteDiscovery = $this->container->get('libraries.definition.discovery.remote');
 }
  /**
   * {@inheritdoc}
   */
  public function setUp() {
    parent::setUp();

    $this->drupalPlaceBlock('local_tasks_block');

    $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
    $this->drupalCreateNode();

    ConfigurableLanguage::create(['id' => 'fi'])->save();

    // In order to reflect the changes for a multilingual site in the container
    // we have to rebuild it.
    $this->rebuildContainer();

    $alias_storage = $this->container->get('path.alias_storage');
    $alias_storage->save('/node/1', '/kittens');
    $alias_white_list = $this->container->get('path.alias_whitelist');
    $alias_white_list->set('node', TRUE);

    $admin_user = $this->drupalCreateUser([
      'bypass node access',
    ]);
    $this->drupalLogin($admin_user);
  }
  /**
   * {@inheritdoc}
   */
  public function setUp() {
    parent::setUp();

    Vocabulary::create(['vid' => 'test'])->save();
  }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->drupalLogin($this->createAdminUser());
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->adminUser = $this->drupalCreateUser(['administer address formats', 'access administration pages', 'administer site configuration']);
     $this->drupalLogin($this->adminUser);
 }
Example #18
0
 protected function setUp()
 {
     parent::setUp();
     $this->adminUser = $this->drupalCreateUser(array('access administration pages'));
 }
Example #19
0
 protected function setUp()
 {
     parent::setUp();
     $this->helpBlock = $this->placeBlock('help_block');
 }
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     // Create user.
     $this->bigUser = $this->drupalCreateUser(['administer themes']);
 }
Example #21
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setUp();
     $this->drupalLogin($this->drupalCreateUser(['administer account settings']));
 }