Beispiel #1
0
 /**
  *
  * @param Symfony\Component\HttpFoundation\Request $request
  */
 public function __construct(Request $request)
 {
     $queryDecorator = new QueryDecorator($this->_getQuery());
     $this->_query = $queryDecorator->decorate($request, $this->_getUrlParamsMapper());
     $this->_curl = new AnonymousCurl();
     $reader = new \Symfony\Component\Yaml\Yaml();
     $this->_config = $reader->parse(__DIR__ . '/../Resources/config/cache.yml');
 }
Beispiel #2
0
 /**
  * @test 
  */
 public function decorateWithExtendedQuery()
 {
     $request = new Request();
     $request->initialize(array('query_string' => 'query=doesnt_matter'));
     $urlParamsMapper = new UrlParamsMapperInterfaceMock();
     $queryDecorator = new QueryDecorator(new QueryMock());
     $query = $queryDecorator->decorate($request, $urlParamsMapper);
     $this->assertEquals('q=label%3Aphp+sf', $query->encode());
 }