Unverified Commit 75316d6a authored by naveenvalecha's avatar naveenvalecha Committed by jibran

Issue #2886713 by naveenvalecha: Convert Tests to BTB from WTB

parent 8bc240bb
<?php
namespace Drupal\contact_storage\Tests;
namespace Drupal\Tests\contact_storage\Functional;
use Drupal\views\Tests\ViewTestData;
......
<?php
namespace Drupal\contact_storage\Tests;
namespace Drupal\Tests\contact_storage\Functional;
use Drupal\Component\Utility\SafeMarkup;
use Drupal\Component\Render\PlainTextOutput;
use Drupal\Core\Session\AccountInterface;
use Drupal\simpletest\WebTestBase;
use Drupal\Core\Test\AssertMailTrait;
use Drupal\Tests\BrowserTestBase;
/**
* Tests personal contact form functionality.
*
* @group contact
*/
class ContactStoragePersonalTest extends WebTestBase {
class ContactStoragePersonalTest extends BrowserTestBase {
use AssertMailTrait {
getMails as drupalGetMails;
}
/**
* Modules to enable.
*
......
<?php
namespace Drupal\contact_storage\Tests;
namespace Drupal\Tests\contact_storage\Functional;
use Drupal\contact\Entity\ContactForm;
use Drupal\Core\Test\AssertMailTrait;
use Drupal\field_ui\Tests\FieldUiTestTrait;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\filter\Entity\FilterFormat;
......@@ -15,6 +16,9 @@ use Drupal\filter\Entity\FilterFormat;
class ContactStorageTest extends ContactStorageTestBase {
use FieldUiTestTrait;
use AssertMailTrait {
getMails as drupalGetMails;
}
/**
* An administrative user with permission to administer contact forms.
......
<?php
namespace Drupal\contact_storage\Tests;
namespace Drupal\Tests\contact_storage\Functional;
use Drupal\simpletest\WebTestBase;
use Drupal\Tests\BrowserTestBase;
/**
* Defines a base-class for contact-storage tests.
*/
abstract class ContactStorageTestBase extends WebTestBase {
abstract class ContactStorageTestBase extends BrowserTestBase {
/**
* Adds a form.
......@@ -33,7 +33,8 @@ abstract class ContactStorageTestBase extends WebTestBase {
$edit['id'] = $id;
// 8.2.x added the message field, which is by default empty. Conditionally
// submit it if the field can be found.
if ($this->xpath($this->constructFieldXpath('name', 'message'))) {
$xpath = '//textarea[@name=:value]|//input[@name=:value]|//select[@name=:value]';
if ($this->xpath($this->buildXPathQuery($xpath, [':value' => 'message']))) {
$edit['message'] = $message;
}
$edit['recipients'] = $recipients;
......
<?php
namespace Drupal\contact_storage\Tests;
namespace Drupal\Tests\contact_storage\Functional;
/**
* Tests adding contact form as entity reference and viewing them through UI.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment