annotate core/modules/search/tests/src/Functional/SearchTestBase.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 129ea1e6d783
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\Tests\search\Functional;
Chris@0 4
Chris@17 5 @trigger_error(__NAMESPACE__ . '\SearchTestBase is deprecated in Drupal 8.6.x and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\BrowserTestBase. See https://www.drupal.org/node/2979950.', E_USER_DEPRECATED);
Chris@17 6
Chris@0 7 use Drupal\Tests\BrowserTestBase;
Chris@0 8
Chris@0 9 /**
Chris@0 10 * Defines the common search test code.
Chris@17 11 *
Chris@17 12 * @deprecated in Drupal 8.6.0 and will be removed in Drupal 9.0.0. Use
Chris@17 13 * \Drupal\Tests\BrowserTestBase instead.
Chris@17 14 *
Chris@17 15 * @see https://www.drupal.org/node/2979950
Chris@0 16 */
Chris@0 17 abstract class SearchTestBase extends BrowserTestBase {
Chris@0 18
Chris@0 19 /**
Chris@0 20 * Modules to enable.
Chris@0 21 *
Chris@0 22 * @var array
Chris@0 23 */
Chris@0 24 public static $modules = ['node', 'search', 'dblog'];
Chris@0 25
Chris@0 26 protected function setUp() {
Chris@0 27 parent::setUp();
Chris@0 28
Chris@0 29 // Create Basic page and Article node types.
Chris@0 30 if ($this->profile != 'standard') {
Chris@0 31 $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
Chris@0 32 $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
Chris@0 33 }
Chris@0 34 }
Chris@0 35
Chris@0 36 /**
Chris@17 37 * Submission of a form via press submit button.
Chris@0 38 *
Chris@0 39 * @param string $path
Chris@0 40 * Location of the form to be submitted: either a Drupal path, absolute
Chris@0 41 * path, or NULL to use the current page.
Chris@0 42 * @param array $edit
Chris@0 43 * Form field data to submit. Unlike drupalPostForm(), this does not support
Chris@0 44 * file uploads.
Chris@0 45 * @param string $submit
Chris@0 46 * Value of the submit button to submit clicking. Unlike drupalPostForm(),
Chris@0 47 * this does not support AJAX.
Chris@0 48 * @param string $form_html_id
Chris@0 49 * (optional) HTML ID of the form, to disambiguate.
Chris@17 50 *
Chris@17 51 * @deprecated in Drupal 8.6.x, to be removed before Drupal 9.0.x. Use
Chris@17 52 * \Drupal\Tests\BrowserTestBase::drupalPostForm() instead.
Chris@17 53 *
Chris@17 54 * @see https://www.drupal.org/node/2979950
Chris@0 55 */
Chris@0 56 protected function submitGetForm($path, $edit, $submit, $form_html_id = NULL) {
Chris@17 57 @trigger_error(__CLASS__ . '::' . __FUNCTION__ . '() is deprecated in Drupal 8.6.x, for removal before the Drupal 9.0.0 release. Use \Drupal\Tests\BrowserTestBase::drupalPostForm() instead. See https://www.drupal.org/node/2979950.', E_USER_DEPRECATED);
Chris@17 58 $this->drupalPostForm($path, $edit, $submit, [], $form_html_id);
Chris@0 59 }
Chris@0 60
Chris@0 61 }