Skip to content

Commit

Permalink
Merge pull request #118 from aik099/specify-test-name-fix
Browse files Browse the repository at this point in the history
Specify test name for manually created TestCase objects
  • Loading branch information
aik099 authored Mar 12, 2024
2 parents 2f6cc43 + 2aebb7c commit 872a8b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -544,11 +544,11 @@ public function sessionSharingDataProvider()
*/
public function testGetSessionStrategyHashNotSharing()
{
$test_case1 = new WithBrowserConfig();
$test_case1 = new WithBrowserConfig('test name');
$browser1 = $this->createBrowserConfiguration();
$browser1->setSessionStrategy(ISessionStrategyFactory::TYPE_SHARED);

$test_case2 = new WithoutBrowserConfig();
$test_case2 = new WithoutBrowserConfig('test name');
$browser2 = $this->createBrowserConfiguration();
$browser2->setSessionStrategy(ISessionStrategyFactory::TYPE_SHARED);

Expand Down
14 changes: 7 additions & 7 deletions tests/aik099/PHPUnit/BrowserTestCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function testSetSessionStrategyManager()
/* @var $manager SessionStrategyManager */
$manager = m::mock(self::MANAGER_CLASS);

$test_case = new WithoutBrowserConfig();
$test_case = new WithoutBrowserConfig('test name');
$test_case->setSessionStrategyManager($manager);

$property = new \ReflectionProperty($test_case, 'sessionStrategyManager');
Expand Down Expand Up @@ -131,7 +131,7 @@ public function testGetBrowserNotSpecified()
{
$this->expectException('RuntimeException');

$test_case = new WithoutBrowserConfig();
$test_case = new WithoutBrowserConfig('test name');
$test_case->getBrowser();
}

Expand Down Expand Up @@ -167,7 +167,7 @@ public function testSetSessionStrategy()
/* @var $session_strategy ISessionStrategy */
$session_strategy = m::mock(self::SESSION_STRATEGY_INTERFACE);

$test_case = new WithoutBrowserConfig();
$test_case = new WithoutBrowserConfig('test name');
$this->assertSame($test_case, $test_case->setSessionStrategy($session_strategy));
$this->assertSame($session_strategy, $test_case->getSessionStrategy());
}
Expand All @@ -185,10 +185,10 @@ public function testGetSessionStrategySharing()

$manager->shouldReceive('getDefaultSessionStrategy')->twice()->andReturn('STRATEGY');

$test_case1 = new WithoutBrowserConfig();
$test_case1 = new WithoutBrowserConfig('test name');
$test_case1->setSessionStrategyManager($manager);

$test_case2 = new WithBrowserConfig();
$test_case2 = new WithBrowserConfig('test name');
$test_case2->setSessionStrategyManager($manager);

$this->assertSame($test_case1->getSessionStrategy(), $test_case2->getSessionStrategy());
Expand Down Expand Up @@ -575,7 +575,7 @@ public function testEndOfTestCase()
/* @var $session_strategy ISessionStrategy */
$session_strategy = m::mock(self::SESSION_STRATEGY_INTERFACE);

$test_case = new WithoutBrowserConfig();
$test_case = new WithoutBrowserConfig('test name');
$test_case->setSessionStrategy($session_strategy);

$session_strategy->shouldReceive('onTestSuiteEnded')->with($test_case)->once();
Expand Down Expand Up @@ -668,7 +668,7 @@ protected function getFixture(ISessionStrategy $session_strategy = null, array $
$test_case = m::mock('\\aik099\\PHPUnit\\BrowserTestCase[' . implode(',', $mock_methods) . ']');
}
else {
$test_case = new WithoutBrowserConfig();
$test_case = new WithoutBrowserConfig('test name');
}

$test_case->setBrowserConfigurationFactory($this->browserConfigurationFactory);
Expand Down

0 comments on commit 872a8b1

Please sign in to comment.