/** * Destroys mink instance. */ public static function tearDownAfterClass() { if (null !== self::$minkTestCaseMinkInstance) { self::$minkTestCaseMinkInstance->stopSessions(); self::$minkTestCaseMinkInstance = null; } }
/** * {@inheritdoc} */ public static function tearDownAfterClass() { if (null !== self::$mink) { self::$mink->stopSessions(); self::$mink = null; } }
/** * {@inheritdoc} */ protected function tearDown() { parent::tearDown(); // Destroy the testing kernel. if (isset($this->kernel)) { $this->cleanupEnvironment(); $this->kernel->shutdown(); } // Ensure that internal logged in variable is reset. $this->loggedInUser = FALSE; if ($this->mink) { $this->mink->stopSessions(); } }
/** * Stops all sessions, that might have started. * * @return void */ public static function tearDownAfterClass() { parent::tearDownAfterClass(); self::$mink->stopSessions(); }
/** * {@inheritdoc} */ protected function tearDown() { parent::tearDown(); // Destroy the testing kernel. if (isset($this->kernel)) { $this->cleanupEnvironment(); $this->kernel->shutdown(); } // Ensure that internal logged in variable is reset. $this->loggedInUser = FALSE; if ($this->mink) { $this->mink->stopSessions(); } // Restore original shutdown callbacks. if (function_exists('drupal_register_shutdown_function')) { $callbacks =& drupal_register_shutdown_function(); $callbacks = $this->originalShutdownCallbacks; } }
Filter::register('mink.register', function ($chain) { $default_browser = getenv('MINK_DEFAULT_BROWSER') !== false ? getenv('MINK_DEFAULT_BROWSER') : 'chrome'; $firefox_location = getenv('SELENIUM_FIREFOX_HOST') !== false ? getenv('SELENIUM_FIREFOX_HOST') : 'localhost'; $chrome_location = getenv('SELENIUM_CHROME_HOST') !== false ? getenv('SELENIUM_CHROME_HOST') : 'localhost'; $firefox_selenium_host = "http://{$firefox_location}:4444/wd/hub"; $chrome_selenium_host = "http://{$chrome_location}:4444/wd/hub"; $mink = new Mink(['firefox' => new Session(new Selenium2Driver('firefox', ['browserName' => 'firefox'], $firefox_selenium_host)), 'chrome' => new Session(new Selenium2Driver('chrome', ['browserName' => 'chrome'], $chrome_selenium_host))]); $mink->setDefaultSessionName($default_browser); /** @var Suite $root */ $root = $this->suite(); $root->mink = $mink; $root->beforeEach(function () use($mink) { $mink->resetSessions(); }); $root->after(function () use($mink) { $mink->stopSessions(); }); return $chain->next(); }); Filter::register('specs.prepare', function ($chain) { $callback = (require_once __DIR__ . '/prepare.php'); /** @var Suite $root */ $root = $this->suite(); $root->before($callback); return $chain->next(); }); Filter::apply($this, 'run', 'mockery.register.close'); Filter::apply($this, 'run', 'mink.register'); Filter::apply($this, 'run', 'symfony.register'); Filter::apply($this, 'interceptor', 'doctrine.exclude.annotations'); Filter::apply($this, 'load', 'specs.default.path');
public function tearDown() { if (is_object($this->mink)) { $this->mink->stopSessions(); } }