-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify driver installation process
- Loading branch information
Showing
7 changed files
with
96 additions
and
54 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
library/aik099/PHPUnit/MinkDriver/AbstractDriverFactory.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
/** | ||
* This file is part of the phpunit-mink library. | ||
* For the full copyright and license information, please view | ||
* the LICENSE file that was distributed with this source code. | ||
* | ||
* @copyright Alexander Obuhovich <[email protected]> | ||
* @link https://github.com/aik099/phpunit-mink | ||
*/ | ||
|
||
|
||
namespace aik099\PHPUnit\MinkDriver; | ||
|
||
|
||
abstract class AbstractDriverFactory implements IMinkDriverFactory | ||
{ | ||
|
||
/** | ||
* Throws an exception with driver installation instructions. | ||
* | ||
* @param string $class_name Driver class name. | ||
* | ||
* @return void | ||
* @throws \RuntimeException When driver isn't installed. | ||
*/ | ||
protected function assertInstalled($class_name) | ||
{ | ||
if ( !class_exists($class_name) ) { | ||
throw new \RuntimeException( | ||
sprintf( | ||
'The "%s" driver is not installed. Please follow installation instructions at %s.', | ||
$this->getDriverName(), | ||
$this->getDriverPackageUrl() | ||
) | ||
); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters