protected function setUp() { parent::setUp(); $_GET = ['foo' => 'bar', 'other' => 'notbar']; $_POST = ['greu' => 'pff', 'another' => 'notpff']; $this->request = Request::createFromGlobals(); }
protected function setUp() { parent::setUp(); $this->serverContext = new ServerContext(); $this->rootPath = dirname(__DIR__) . '/fixtures'; $this->kernel = new Kernel($this->rootPath, 'fooEnv', $this->serverContext); }
protected function setUp() { parent::setUp(); $this->localizer = $this->getBasicMock('\\horses\\i18n\\Localizer'); $this->localizer->expects($this->any())->method('getAvailableLocales')->will($this->returnValue(['en_CA', 'fr_CA'])); $this->translator = new Translator($this->localizer, [$this->getFixturesPath() . '/i18n', '/blah']); }
protected function setUp() { parent::setUp(); $loader = $this->getBasicMock('\\horses\\config\\YamlFileLoader'); $loader->expects($this->any())->method('load')->will($this->returnValue([['blah' => 'overwrittennotdeep', 'onlyinfirst' => 'onlyinfirst', 'deep' => ['deepkey' => 'overwrittendeep']], ['blah' => 'pfff', 'onlyinsecond' => 'onlyinsecond', 'deep' => ['deepkey' => 'deepval']]])); $this->config = new Config('test', $loader); }
protected function setUp() { parent::setUp(); $this->session = $this->getBasicMock('\\Symfony\\Component\\HttpFoundation\\Session\\Session'); $sv =& $this->storedValues; $this->session->expects($this->any())->method('set')->will($this->returnCallback(function ($key, $value) use(&$sv) { $sv[$key] = $value; })); $this->state = new State($this->session); }
protected function setUp() { parent::setUp(); $configOne = $this->getBasicMock('\\horses\\config\\Config'); $configTwo = $this->getBasicMock('\\horses\\config\\Config'); $configOne->expects($this->any())->method('get')->will($this->returnValue('foo')); $factory = $this->getBasicMock('\\horses\\config\\Factory'); $factory->expects($this->any())->method('getConfig')->will($this->returnValueMap([['one', $configOne], ['two', $configTwo]])); $this->collection = new Collection($factory); $this->collection->load('one')->load('two'); }
protected function setUp() { parent::setUp(); $fileLocator = $this->getBasicMock('\\Symfony\\Component\\Config\\FileLocatorInterface'); $fileLocator->expects($this->any())->method('locate')->will($this->returnCallback(function ($resource) { if ($resource == 'config.yml') { return [$this->getFixturesPath() . '/config/config.yml']; } throw new \InvalidArgumentException(); })); $this->yamlFileLoader = new YamlFileLoader($fileLocator); }
protected function setUp() { parent::setUp(); $serverContext = $this->getBasicMock('\\horses\\ServerContext'); $serverContext->expects($this->any())->method('set')->will($this->returnCallback(function ($key, $value) use(&$sv) { $sv[$key] = $value; })); $config = $this->getBasicMock('\\horses\\config\\Config'); $config->expects($this->any())->method('get')->will($this->returnCallback(function ($key, $default) { $vals = [Router::CONFIG_KEY_PREFIX => $this->routePrefix, Router::CONFIG_KEY_ACTION_SUBNAMESPACES => '', Router::CONFIG_KEY_ACTION_NAMESPACE => $this->actionNamespace]; return $vals[$key]; })); $configCollection = $this->getBasicMock('\\horses\\config\\Collection'); $configCollection->expects($this->any())->method('getSection')->will($this->returnValue($config)); $configCollection->expects($this->any())->method('load')->will($this->returnSelf()); $this->router = new Router($serverContext, $configCollection); }
protected function setUp() { parent::setUp(); $this->fileTemplate = $this->getMockForAbstractClass('\\horses\\responder\\view\\FileTemplate'); $this->fileTemplate->expects($this->any())->method('getTemplatePath')->will($this->returnValue($this->getFixturesPath() . '/view/file_template.html.php')); }
protected function setUp() { parent::setUp(); $this->creds = new UsernamePasswordCredentials('test', 'foo'); }
protected function setUp() { parent::setUp(); $this->userId = new UserId('test'); }
protected function setUp() { parent::setUp(); $this->serverContext = new ServerContext(); }
protected function setUp() { parent::setUp(); $this->authenticator = new Authenticator(); }