WindowNameTest.php 728 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Behat\Mink\Tests\Driver\Custom;
  3. use Behat\Mink\Tests\Driver\TestCase;
  4. class WindowNameTest extends TestCase
  5. {
  6. const WINDOW_NAME_REGEXP = '/[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}/i';
  7. public function testPatternGetWindowNames()
  8. {
  9. $session = $this->getSession();
  10. $windowNames = $session->getWindowNames();
  11. $this->assertArrayHasKey(0, $windowNames);
  12. foreach ($windowNames as $name) {
  13. $this->assertRegExp(self::WINDOW_NAME_REGEXP, $name);
  14. }
  15. }
  16. public function testGetWindowName()
  17. {
  18. $session = $this->getSession();
  19. $this->assertRegExp(self::WINDOW_NAME_REGEXP, $session->getWindowName());
  20. }
  21. }