diff --git a/src/PhpSeleniumServer.php b/src/PhpSeleniumServer.php index 1e78b3c..99cbc78 100644 --- a/src/PhpSeleniumServer.php +++ b/src/PhpSeleniumServer.php @@ -22,7 +22,7 @@ public function __construct(string $seleniumServerPath = null) } $this->seleniumServerPath = $seleniumServerPath; } else { - $seleniumServerPath = dirname(dirname(__FILE__)).'/vendor/bin/selenium-server-standalone'; + $seleniumServerPath = dirname(dirname(dirname(dirname(dirname(__FILE__))))).'/vendor/bin/selenium-server-standalone'; if (!file_exists($seleniumServerPath)) { throw new PhpSeleniumServerException('Not found selenium-server-standalone. Please specify the file path.'); } diff --git a/tests/PhpSeleniumServerTest.php b/tests/PhpSeleniumServerTest.php index ed47a94..6cd6787 100644 --- a/tests/PhpSeleniumServerTest.php +++ b/tests/PhpSeleniumServerTest.php @@ -8,7 +8,7 @@ public function testGetPidIsNull() /** * @var \Hayatravis\Pss\PhpSeleniumServer $mock */ - $mock = Phake::partialMock('Hayatravis\Pss\PhpSeleniumServer'); + $mock = Phake::partialMock('Hayatravis\Pss\PhpSeleniumServer', dirname(dirname(__FILE__)).'/vendor/bin/selenium-server-standalone'); $this->assertNull($mock->getPid()); } @@ -24,7 +24,7 @@ public function testGetPid() /** * @var \Hayatravis\Pss\PhpSeleniumServer $mock */ - $mock = Phake::partialMock('Hayatravis\Pss\PhpSeleniumServer'); + $mock = Phake::partialMock('Hayatravis\Pss\PhpSeleniumServer', dirname(dirname(__FILE__)).'/vendor/bin/selenium-server-standalone'); $mock->startSeleniumServer(); $this->assertNotNull($mock->getPid()); $mock->stopSeleniumServer(); @@ -35,7 +35,7 @@ public function testStartSeleniumServer() /** * @var \Hayatravis\Pss\PhpSeleniumServer $mock */ - $mock = Phake::partialMock('Hayatravis\Pss\PhpSeleniumServer'); + $mock = Phake::partialMock('Hayatravis\Pss\PhpSeleniumServer', dirname(dirname(__FILE__)).'/vendor/bin/selenium-server-standalone'); $mock->startSeleniumServer(); $command = 'ps aux | grep selenium-server-standalone'; passthru($command); @@ -48,7 +48,7 @@ public function testIsStopSeleniumServerIsTrue() /** * @var \Hayatravis\Pss\PhpSeleniumServer $mock */ - $mock = Phake::partialMock('Hayatravis\Pss\PhpSeleniumServer'); + $mock = Phake::partialMock('Hayatravis\Pss\PhpSeleniumServer', dirname(dirname(__FILE__)).'/vendor/bin/selenium-server-standalone'); $mock->startSeleniumServer(); $this->assertFalse($mock->isStopSeleniumServer()); $mock->stopSeleniumServer(); @@ -59,7 +59,7 @@ public function testIsStopSeleniumServerIsFalse() /** * @var \Hayatravis\Pss\PhpSeleniumServer $mock */ - $mock = Phake::partialMock('Hayatravis\Pss\PhpSeleniumServer'); + $mock = Phake::partialMock('Hayatravis\Pss\PhpSeleniumServer', dirname(dirname(__FILE__)).'/vendor/bin/selenium-server-standalone'); $this->assertTrue($mock->isStopSeleniumServer()); } } \ No newline at end of file