public function testClearEndpoints() { $endpoint1 = $this->client->createEndpoint('s1'); $endpoint2 = $this->client->createEndpoint('s2'); $this->client->setEndpoints(array($endpoint1, $endpoint2)); $this->client->clearEndpoints(); $this->assertEquals(array(), $this->client->getEndpoints()); }
public function testAddAndGetQueries() { $client = new Client(); $client->clearEndpoints(); $client->createEndpoint('local1'); $endpoint2 = $client->createEndpoint('local2'); $this->plugin->initPlugin($client, array()); $query1 = $client->createSelect()->setQuery('test1'); $query2 = $client->createSelect()->setQuery('test2'); $this->plugin->addQuery(1, $query1); $this->plugin->addQuery(2, $query2, $endpoint2); $this->assertEquals(array(1 => array('query' => $query1, 'endpoint' => 'local1'), 2 => array('query' => $query2, 'endpoint' => 'local2')), $this->plugin->getQueries()); }