library_manager-8.x-1.0/tests/src/Functional/SettingsFormTest.php

tests/src/Functional/SettingsFormTest.php
<?php

namespace Drupal\Tests\library_manager\Functional;

/**
 * Tests settings form.
 *
 * @group library_manager
 */
class SettingsFormTest extends TestBase {

  /**
   * Test callback.
   */
  public function testSettingsForm() {
    $this->drupalGet('admin/structure/library/settings');
    $form_prefix = '//form[@id = "library-manager-settings"]';
    $this->assertXpath($form_prefix . '//input[@name = "libraries_path" and @value = "sites/default/files/libraries/custom"]');
    $edit = [
      'libraries_path' => 'sites/default/files/foo',
    ];
    $this->submitForm($edit, 'Save configuration');
    $this->assertStatusMessage('The configuration options have been saved.');
    $this->assertXpath($form_prefix . '//input[@name = "libraries_path" and @value = "sites/default/files/foo"]');
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc