-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#13 added support for recursive mandatory options
- Loading branch information
1 parent
8905c15
commit 175bba1
Showing
6 changed files
with
168 additions
and
11 deletions.
There are no files selected for viewing
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
59 changes: 59 additions & 0 deletions
59
benchmark/HasMandatoryOptionsRecursiveContainerIdBench.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,59 @@ | ||
<?php | ||
/** | ||
* Sake | ||
* | ||
* @link http://github.com/sandrokeil/interop-config for the canonical source repository | ||
* @copyright Copyright (c) 2015 Sandro Keil | ||
* @license http://github.com/sandrokeil/interop-config/blob/master/LICENSE.txt New BSD License | ||
*/ | ||
|
||
namespace InteropBench\Config; | ||
|
||
use InteropTest\Config\TestAsset\ConnectionMandatoryRecursiveContainerIdConfiguration; | ||
|
||
/** | ||
* @beforeMethod classSetUp | ||
*/ | ||
class HasMandatoryOptionsRecursiveContainerId | ||
{ | ||
private $config; | ||
|
||
/** | ||
* @var ConnectionMandatoryRecursiveContainerIdConfiguration | ||
*/ | ||
private $factory; | ||
|
||
public function classSetUp() | ||
{ | ||
$this->config = $this->getTestConfig(); | ||
$this->factory = new ConnectionMandatoryRecursiveContainerIdConfiguration(); | ||
} | ||
|
||
/** | ||
* Retrieve options | ||
* | ||
* @revs 1000 | ||
* @iterations 10 | ||
*/ | ||
public function options() | ||
{ | ||
$this->factory->options($this->config); | ||
} | ||
|
||
/** | ||
* Returns test config | ||
* | ||
* @return array | ||
*/ | ||
private function getTestConfig() | ||
{ | ||
// Load the user-defined test configuration file, if it exists; otherwise, load default | ||
if (is_readable('test/TestConfig.php')) { | ||
$testConfig = require 'test/testing.config.php'; | ||
} else { | ||
$testConfig = require 'test/testing.config.php.dist'; | ||
} | ||
|
||
return $testConfig; | ||
} | ||
} |
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
43 changes: 43 additions & 0 deletions
43
test/TestAsset/ConnectionMandatoryRecursiveContainerIdConfiguration.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,43 @@ | ||
<?php | ||
/** | ||
* Sake | ||
* | ||
* @link http://github.com/sandrokeil/interop-config for the canonical source repository | ||
* @copyright Copyright (c) 2014 - 2015 Sandro Keil | ||
* @license http://github.com/sandrokeil/interop-config/blob/master/LICENSE.txt New BSD License | ||
*/ | ||
|
||
namespace InteropTest\Config\TestAsset; | ||
|
||
use Interop\Config\ConfigurationTrait; | ||
use Interop\Config\HasContainerId; | ||
use Interop\Config\HasMandatoryOptions; | ||
use Interop\Config\ObtainsOptions; | ||
|
||
class ConnectionMandatoryRecursiveContainerIdConfiguration implements | ||
ObtainsOptions, | ||
HasContainerId, | ||
HasMandatoryOptions | ||
{ | ||
use ConfigurationTrait; | ||
|
||
public function vendorName() | ||
{ | ||
return 'doctrine'; | ||
} | ||
|
||
public function packageName() | ||
{ | ||
return 'connection'; | ||
} | ||
|
||
public function containerId() | ||
{ | ||
return 'orm_default'; | ||
} | ||
|
||
public function mandatoryOptions() | ||
{ | ||
return ['driverClass', 'params' => ['user', 'dbname']]; | ||
} | ||
} |