예제 #1
0
 protected function setUp()
 {
     parent::setUp();
     $_GET = ['foo' => 'bar', 'other' => 'notbar'];
     $_POST = ['greu' => 'pff', 'another' => 'notpff'];
     $this->request = Request::createFromGlobals();
 }
예제 #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);
 }
예제 #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']);
 }
예제 #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);
 }
예제 #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);
 }
예제 #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');
 }
예제 #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);
 }
예제 #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);
 }
예제 #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');
 }
예제 #11
0
 protected function setUp()
 {
     parent::setUp();
     $this->userId = new UserId('test');
 }
예제 #12
0
 protected function setUp()
 {
     parent::setUp();
     $this->serverContext = new ServerContext();
 }
예제 #13
0
 protected function setUp()
 {
     parent::setUp();
     $this->authenticator = new Authenticator();
 }