3 namespace Behat\Mink\Tests\Driver\Custom;
5 use Behat\Mink\Tests\Driver\TestCase;
7 class WindowNameTest extends TestCase
9 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';
11 public function testPatternGetWindowNames()
13 $session = $this->getSession();
15 $windowNames = $session->getWindowNames();
16 $this->assertArrayHasKey(0, $windowNames);
18 foreach ($windowNames as $name) {
19 $this->assertRegExp(self::WINDOW_NAME_REGEXP, $name);
23 public function testGetWindowName()
25 $session = $this->getSession();
27 $this->assertRegExp(self::WINDOW_NAME_REGEXP, $session->getWindowName());