Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/PhpSeleniumServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
}
Expand Down
10 changes: 5 additions & 5 deletions tests/PhpSeleniumServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand All @@ -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();
Expand All @@ -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);
Expand All @@ -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();
Expand All @@ -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());
}
}