Skip to content

Commit

Permalink
Use constants from class, that declares them
Browse files Browse the repository at this point in the history
  • Loading branch information
aik099 committed Mar 12, 2024
1 parent c680b30 commit 2f6cc43
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/aik099/PHPUnit/Fixture/SetupFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
namespace tests\aik099\PHPUnit\Fixture;


use aik099\PHPUnit\BrowserConfiguration\ApiBrowserConfiguration;
use aik099\PHPUnit\BrowserConfiguration\IBrowserConfigurationFactory;
use aik099\PHPUnit\BrowserConfiguration\SauceLabsBrowserConfiguration;
use aik099\PHPUnit\BrowserTestCase;
Expand Down Expand Up @@ -42,7 +43,7 @@ protected function setUpTest()
// These magic methods can't be properly passed through to mocked object otherwise.
$browser->shouldReceive('getSessionStrategy')->andReturn('isolated');
$browser->shouldReceive('getDesiredCapabilities')->andReturn(array(
SauceLabsBrowserConfiguration::NAME_CAPABILITY => 'something',
ApiBrowserConfiguration::NAME_CAPABILITY => 'something',
));

$browser->shouldReceive('getAPIClient')->once()->andReturn($api_client);
Expand Down Expand Up @@ -90,17 +91,17 @@ public function testEvents()

$session = m::mock('Behat\\Mink\\Session');

// For SauceLabsBrowserConfiguration::onTestEnded.
// For ApiBrowserConfiguration::onTestEnded.
$session->shouldReceive('getDriver')->once()->andReturn($driver);

$session->shouldReceive('stop')->once();
$session->shouldReceive('isStarted')->andReturn(true);

$this->_setSession($session);

// For SauceLabsBrowserConfiguration::onTestSetup.
// For ApiBrowserConfiguration::onTestSetup.
$desired_capabilities = $this->getBrowser()->getDesiredCapabilities();
$this->assertArrayHasKey(SauceLabsBrowserConfiguration::NAME_CAPABILITY, $desired_capabilities);
$this->assertArrayHasKey(ApiBrowserConfiguration::NAME_CAPABILITY, $desired_capabilities);
}

/**
Expand Down

0 comments on commit 2f6cc43

Please sign in to comment.