/**
  * Returns test case fixture.
  *
  * @param ISessionStrategy|null $session_strategy Session strategy.
  * @param array                 $mock_methods     Method names to mock.
  *
  * @return WithoutBrowserConfig
  */
 protected function getFixture(ISessionStrategy $session_strategy = null, array $mock_methods = array())
 {
     if (!isset($session_strategy)) {
         $session_strategy = m::mock(self::SESSION_STRATEGY_INTERFACE);
     }
     /* @var $manager SessionStrategyManager */
     $manager = m::mock(self::MANAGER_CLASS);
     $manager->shouldReceive('getSessionStrategy')->andReturn($session_strategy);
     if ($mock_methods) {
         $test_case = m::mock('\\aik099\\PHPUnit\\BrowserTestCase[' . implode(',', $mock_methods) . ']');
     } else {
         $test_case = new WithoutBrowserConfig();
     }
     $test_case->setEventDispatcher($this->eventDispatcher);
     $test_case->setBrowserConfigurationFactory($this->browserConfigurationFactory);
     $test_case->setSessionStrategyManager($manager);
     return $test_case;
 }
Esempio n. 2
0
 /**
  * Tests, that suite is built correctly in case, when no browser configuration is defined ahead.
  *
  * @return void
  */
 public function testWithoutBrowserConfiguration()
 {
     $suite = WithoutBrowserConfig::suite(self::TEST_CASE_WITHOUT_CONFIG);
     $this->assertInstanceOf(self::SUITE_CLASS, $suite);
     $this->checkArray($suite->tests(), 2, self::TEST_CASE_WITHOUT_CONFIG);
 }