JavascriptTestBase.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace Drupal\FunctionalJavascriptTests;
  3. @trigger_error('The ' . __NAMESPACE__ . '\JavascriptTestBase is deprecated in Drupal 8.5.x and will be removed before Drupal 9.0.0. Instead, use ' . __NAMESPACE__ . '\WebDriverTestBase. See https://www.drupal.org/node/2945059', E_USER_DEPRECATED);
  4. use Zumba\Mink\Driver\PhantomJSDriver;
  5. /**
  6. * Runs a browser test using PhantomJS.
  7. *
  8. * Base class for testing browser interaction implemented in JavaScript.
  9. *
  10. * @deprecated in Drupal 8.6.x, will be removed before Drupal 9.0.0.
  11. * Use \Drupal\FunctionalJavascriptTests\WebDriverTestBase instead
  12. *
  13. * @see https://www.drupal.org/node/2945059
  14. */
  15. abstract class JavascriptTestBase extends WebDriverTestBase {
  16. /**
  17. * {@inheritdoc}
  18. */
  19. protected $minkDefaultDriverClass = PhantomJSDriver::class;
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function assertSession($name = NULL) {
  24. // Return a WebAssert that supports status code and header assertions.
  25. return new JSWebAssert($this->getSession($name), $this->baseUrl);
  26. }
  27. }