Beispiel #1
0
 protected function setUp()
 {
     parent::setUp();
     $_GET = ['foo' => 'bar', 'other' => 'notbar'];
     $_POST = ['greu' => 'pff', 'another' => 'notpff'];
     $this->request = Request::createFromGlobals();
 }
Beispiel #2
0
 protected function setUp()
 {
     parent::setUp();
     $this->serverContext = new ServerContext();
     $this->rootPath = dirname(__DIR__) . '/fixtures';
     $this->kernel = new Kernel($this->rootPath, 'fooEnv', $this->serverContext);
 }
Beispiel #3
0
 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']);
 }
Beispiel #4
0
 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);
 }
Beispiel #5
0
 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);
 }
Beispiel #6
0
 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');
 }
Beispiel #7
0
 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);
 }
Beispiel #8
0
 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);
 }
Beispiel #9
0
 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');
 }
Beispiel #11
0
 protected function setUp()
 {
     parent::setUp();
     $this->userId = new UserId('test');
 }
Beispiel #12
0
 protected function setUp()
 {
     parent::setUp();
     $this->serverContext = new ServerContext();
 }
Beispiel #13
0
 protected function setUp()
 {
     parent::setUp();
     $this->authenticator = new Authenticator();
 }