From 02b89dc95dad068b3e10fbe1992ceac3faa08623 Mon Sep 17 00:00:00 2001 From: Bill Shupp Date: Wed, 30 May 2012 18:53:01 -0700 Subject: [PATCH] Get WebDriver-PHP tests working with current PHPUnit version * Throw/Expect new WebDriver_Exception instead of Exception * Add default $six_hex value of null to eliminate warnings (which become exceptions in PHPUnit's error handling) * Use preg_split() instead of the deprecated split() to eliminate deperecation warnings * Expect PHPUnit_Framework_ExpectationFailedException when appropriate --- WebDriver.php | 9 ++++++--- WebDriver/Exception.php | 5 +++++ WebDriverColorTest.php | 2 +- WebDriverSelectorTest.php | 2 +- WebDriverXPathTest.php | 2 +- 5 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 WebDriver/Exception.php diff --git a/WebDriver.php b/WebDriver.php index 43a35c4..9d6cf41 100644 --- a/WebDriver.php +++ b/WebDriver.php @@ -1,5 +1,7 @@ '008080', 'aqua' => '00FFFF', ); + $six_hex = null; if (preg_match('/^rgb\(([0-9]+),\s*([0-9]+),\s*([0-9]+)\)$/', $color, $rgb)) { // rgb(255, 255, 255) -> ffffff if (0 <= $rgb[1] && $rgb[1] <= 255 && 0 <= $rgb[2] && $rgb[2] <= 255 && 0 <= $rgb[3] && $rgb[3] <= 255) { diff --git a/WebDriver/Exception.php b/WebDriver/Exception.php new file mode 100644 index 0000000..ee5687b --- /dev/null +++ b/WebDriver/Exception.php @@ -0,0 +1,5 @@ +