_plugin = new Solarium_Plugin_ParallelExecution(); } public function testAddAndGetQueries() { $client1 = new Solarium_Client(); $client2 = new Solarium_Client(array( 'adapter' => 'MyAdapter', 'adapteroptions' => array( 'host' => 'myhost', ) ) ); $this->_plugin->init($client1, array()); $query1 = $client1->createSelect()->setQuery('test1'); $query2 = $client1->createSelect()->setQuery('test2'); $this->_plugin->addQuery(1, $query1); $this->_plugin->addQuery(2, $query2, $client2); $this->assertEquals( array( 1 => array('query' => $query1, 'client' => $client1), 2 => array('query' => $query2, 'client' => $client2), ), $this->_plugin->getQueries() ); } public function testClearQueries() { $client = new Solarium_Client(); $this->_plugin->init($client, array()); $query1 = $client->createSelect()->setQuery('test1'); $query2 = $client->createSelect()->setQuery('test2'); $this->_plugin->addQuery(1, $query1); $this->_plugin->addQuery(2, $query2); $this->_plugin->clearQueries(); $this->assertEquals( array(), $this->_plugin->getQueries() ); } }