예제 #1
0
 /**
  * @dataProvider openedDataProvider
  */
 public function testOpened($url, $matched)
 {
     /* @var $page Page */
     $page = m::mock($this->pageClass);
     $this->expectMatchUrlExactAnnotation($page, array(array('url' => 'http://www.domain.tld/relative'), array('url' => 'http://www.domain.tld/relative/path1'), array('url' => 'http://www.domain.tld/relative/path2')));
     $this->expectMatchUrlRegexpAnnotation($page, array(array('regexp' => '#/absolute$#')));
     $this->expectMatchUrlComponentAnnotation($page, array(array('path' => '/relative/path')));
     $this->session->shouldReceive('getCurrentUrl')->once()->andReturn($url);
     $this->assertSame($matched, $this->realFactory->opened($page));
 }