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
<?php namespace Acme\Controllers; | |
use Acme\Repositories\UserRepositoryInterface as UserRepository; | |
class UsersController extends \BaseController | |
{ | |
protected $userRepository; | |
public function __construct(UserRepository $userRepository) | |
{ |
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
<?php | |
// ... etc | |
// in bootstrap/start.php | |
$env = $app->detectEnvironment(array( | |
'local' => array('localhost'), | |
'staging' => array('staging.domain.org'), | |
'production' => array('domain.org'), | |
)); |
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
<?php | |
// ... etc | |
// in bootstrap/start.php | |
$env = $app->detectEnvironment(function () | |
{ | |
return require __DIR__.'/environment.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
<?php | |
// ... etc | |
// in bootstrap/start.php | |
$env = $app->detectEnvironment(function () | |
{ | |
return getenv('APP_ENV'); | |
}); |
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
<?php | |
class Config | |
{ | |
protected $settings; | |
public function __construct($settings = array()) | |
{ | |
$this->settings = $settings; | |
} |
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
<?php | |
namespace spec; | |
use PhpSpec\ObjectBehavior; | |
use Prophecy\Argument; | |
class ConfigSpec extends ObjectBehavior | |
{ | |
function it_is_initializable() |
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
<?php | |
use Behat\Behat\Tester\Exception\PendingException; | |
use Behat\Behat\Context\SnippetAcceptingContext; | |
use Behat\Gherkin\Node\PyStringNode; | |
use Behat\Gherkin\Node\TableNode; | |
use org\bovigo\vfs\vfsStream; | |
/** |
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
Feature: Configuration Files | |
In order to configure my application | |
As a developer | |
I need to be able to store configuration options in a file | |
Scenario: Getting a configured option | |
Given there is a configuration file | |
And the option 'timezone' is configured to 'UTC' | |
When I load the configuration file | |
Then I should get 'UTC' as 'timezone' option |
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
<?php | |
/** ... etc ... */ | |
class FeatureContext implements SnippetAcceptingContext | |
{ | |
protected $filesystem; | |
protected $config; | |
protected $sut; |
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
<?php | |
/* UserRepository.php */ | |
namespace Acme\Repositories; | |
class UserRepository extends AbstractRepository implements UserRepositoryInterface | |
{ | |
// etc... | |
} |