/** * @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()); }
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()); }
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()); }
public function setUp() { $this->plugin = new PrefetchIterator(); $this->client = new Client(); $this->query = $this->client->createSelect(); }