コード例 #1
0
 /**
  * @depends testConstructorAndGetters
  *
  * @param PreCreateResult $event
  */
 public function testSetAndGetQuery($event)
 {
     $client = new Client();
     $query = $client->createSelect();
     $query->setQuery('test123');
     $response = new Response('', array('HTTP 1.0 200 OK'));
     $result = new Result($client, $query, $response);
     $event->setResult($result);
     $this->assertEquals($result, $event->getResult());
 }
コード例 #2
0
ファイル: PostExecuteTest.php プロジェクト: lhess/solarium
 public function testConstructorAndGetters()
 {
     $client = new Client();
     $query = $client->createSelect();
     $query->setQuery('test123');
     $response = new Response('', array('HTTP 1.0 200 OK'));
     $result = new Result($client, $query, $response);
     $event = new PostExecute($query, $result);
     $this->assertEquals($query, $event->getQuery());
     $this->assertEquals($result, $event->getResult());
 }
コード例 #3
0
 public function testPluginIntegration()
 {
     $client = new Client();
     $client->registerPlugin('testplugin', $this->plugin);
     $this->plugin->setMaxQueryStringLength(1);
     // this forces POST for even the smallest queries
     $query = $client->createSelect();
     $request = $client->createRequest($query);
     // default method is GET, the plugin should have changed this to POST
     $this->assertEquals(Request::METHOD_POST, $request->getMethod());
 }
コード例 #4
0
 public function setUp()
 {
     $this->plugin = new PrefetchIterator();
     $this->client = new Client();
     $this->query = $this->client->createSelect();
 }