JavascriptTestBase.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  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.0 and is removed from drupal:9.0.0.
  11. * Use \Drupal\FunctionalJavascriptTests\WebDriverTestBase instead
  12. *
  13. * @see https://www.drupal.org/node/2945059
  14. *
  15. * @ingroup testing
  16. */
  17. abstract class JavascriptTestBase extends WebDriverTestBase {
  18. /**
  19. * {@inheritdoc}
  20. */
  21. protected $minkDefaultDriverClass = PhantomJSDriver::class;
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function assertSession($name = NULL) {
  26. // Return a WebAssert that supports status code and header assertions.
  27. return new JSWebAssert($this->getSession($name), $this->baseUrl);
  28. }
  29. }