You are here

class WebTestBase in Feeds XPath Parser 8

Test single feeds.

Hierarchy

  • class \Drupal\feeds_xpathparser\WebTestBase extends \Drupal\feeds\FeedsWebTestBase

Expanded class hierarchy of WebTestBase

2 files declare their use of WebTestBase
XPathHTMLParserTest.php in lib/Drupal/feeds_xpathparser/Tests/XPathHTMLParserTest.php
Contains Drupal\feeds_xpathparser\Tests\XPathHTMLParserTest.
XPathXMLParserTest.php in lib/Drupal/feeds_xpathparser/Tests/XPathXMLParserTest.php
Contains Drupal\feeds_xpathparser\Tests\XPathXMLParserTest.

File

lib/Drupal/feeds_xpathparser/WebTestBase.php, line 15
Contains Drupal\feeds_xpathparser\WebTestBase.

Namespace

Drupal\feeds_xpathparser
View source
class WebTestBase extends FeedsWebTestBase {
  const FEEDS_BASE = 'admin/structure/feeds/manage';

  /**
   * Modules to enable.
   *
   * @var array
   */
  public static $modules = array(
    'feeds_xpathparser',
  );

  /**
   * Set up test.
   */
  public function setUp() {
    parent::setUp();

    // Set the teaser length display to unlimited otherwise tests looking for
    // text on nodes will fail.
    $edit = array(
      'fields[body][type]' => 'text_default',
    );
    $this
      ->drupalPost('admin/structure/types/manage/article/display/teaser', $edit, 'Save');
  }

  /**
   * Posts to a URL and checks the field values.
   *
   * @param string $url
   *   The url to POST to.
   * @param array $edit
   *   The form values.
   * @param string $button
   *   The button to press.
   * @param string $saved_text
   *   The save message text.
   */
  protected function postAndCheck($url, $edit, $button, $saved_text) {
    $this
      ->drupalPost($url, $edit, $button);
    $this
      ->assertText($saved_text);
    $this
      ->drupalGet($url);
    foreach ($edit as $key => $value) {
      $this
        ->assertFieldByName($key, $value);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
WebTestBase::$modules public static property Modules to enable.
WebTestBase::FEEDS_BASE constant
WebTestBase::postAndCheck protected function Posts to a URL and checks the field values.
WebTestBase::setUp public function Set up test.