Skip to content

Commit ac6d82f

Browse files
author
Janos Pasztor
committed
Issue php-webdriver#212 - Moving forward
Implemented namespacing as discussed (needs testing)
1 parent 311fdcf commit ac6d82f

File tree

143 files changed

+936
-323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+936
-323
lines changed

composer.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"name": "opsbears/webdriver",
3-
"description": "A php client for WebDriver (fork of facebook/webdriver)",
2+
"name": "facebook/webdriver",
3+
"description": "A php client for WebDriver",
44
"keywords": ["webdriver", "selenium", "php"],
5-
"homepage": "https://github.com/opsbears/php-webdriver",
5+
"homepage": "https://github.com/facebook/php-webdriver",
66
"type": "library",
77
"license": "Apache-2.0",
88
"support": {
9-
"issues": "https://github.com/opsbears/php-webdriver/issues",
10-
"source": "https://github.com/opsbears/php-webdriver"
9+
"issues": "https://github.com/facebook/php-webdriver/issues",
10+
"source": "https://github.com/facebook/php-webdriver"
1111
},
1212
"require": {
1313
"php": ">=5.3.19"
@@ -17,7 +17,9 @@
1717
"phpdocumentor/phpdocumentor": "2.*"
1818
},
1919
"autoload": {
20-
"classmap": ["lib/"]
20+
"psr-4": {
21+
"Facebook\\WebDriver\\": "lib/"
22+
}
2123
},
2224
"minimum-stability": "dev"
2325
}

example.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22
// An example of using php-webdriver.
33

4-
namespace Selenium\WebDriver;
4+
namespace Facebook\WebDriver;
55

6-
require_once('lib/__init__.php');
6+
require_once('vendor/autoload.php');
77

88
// start Firefox with 5 second timeout
99
$host = 'http://localhost:4444/wd/hub'; // this is the default

lib/chrome/ChromeDriver.php renamed to lib/ChromeDriver.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
namespace Selenium\WebDriver;
16+
namespace Facebook\WebDriver;
17+
18+
use Facebook\WebDriver\Exception\WebDriverException;
1719

1820
class ChromeDriver extends RemoteWebDriver {
1921

lib/chrome/ChromeDriverService.php renamed to lib/ChromeDriverService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
namespace Selenium\WebDriver;
16+
namespace Facebook\WebDriver;
1717

1818
class ChromeDriverService extends DriverService {
1919

lib/chrome/ChromeOptions.php renamed to lib/ChromeOptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
namespace Selenium\WebDriver;
16+
namespace Facebook\WebDriver;
1717

1818
/**
1919
* The class manages the capabilities in ChromeDriver.

lib/remote/DesiredCapabilities.php renamed to lib/DesiredCapabilities.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
namespace Selenium\WebDriver;
16+
namespace Facebook\WebDriver;
17+
18+
use Exception;
1719

1820
class DesiredCapabilities implements WebDriverCapabilities {
1921

lib/remote/DriverCommand.php renamed to lib/DriverCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
namespace Selenium\WebDriver;
16+
namespace Facebook\WebDriver;
1717

1818
/**
1919
* This list of command defined in the WebDriver json wire protocol.

lib/remote/service/DriverCommandExecutor.php renamed to lib/DriverCommandExecutor.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
namespace Selenium\WebDriver;
16+
namespace Facebook\WebDriver;
17+
use Facebook\WebDriver\Exception\WebDriverException;
1718

1819
/**
1920
* A HttpCommandExecutor that talks to a local driver service instead of
@@ -48,7 +49,7 @@ public function execute(WebDriverCommand $command, $curl_opts = array()) {
4849
$this->service->stop();
4950
}
5051
return $value;
51-
} catch (Exception $e) {
52+
} catch (\Exception $e) {
5253
if (!$this->service->isRunning()) {
5354
throw new WebDriverException('The driver server has died.');
5455
}

lib/remote/service/DriverService.php renamed to lib/DriverService.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
namespace Selenium\WebDriver;
16+
namespace Facebook\WebDriver;
17+
18+
use Exception;
1719

1820
class DriverService {
1921

lib/support/events/EventFiringWebDriver.php renamed to lib/EventFiringWebDriver.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
1515

16-
namespace Selenium\WebDriver;
16+
namespace Facebook\WebDriver;
17+
18+
use Facebook\WebDriver\Exception\UnsupportedOperationException;
19+
use Facebook\WebDriver\Exception\WebDriverException;
1720

1821
class EventFiringWebDriver implements WebDriver, JavaScriptExecutor {
1922

0 commit comments

Comments
 (0)