Skip to content

Instantly share code, notes, and snippets.

@stovak
Created November 13, 2012 22:14
Show Gist options
  • Save stovak/4068794 to your computer and use it in GitHub Desktop.
Save stovak/4068794 to your computer and use it in GitHub Desktop.
Test Solr Server Creation.
public function testCreateDestroy() {
$ssh = new \Apigee\Shiva\SolrProvisioner();
$server = $ssh->getServer("dit");
for($x=0; $x < 10 ; $x++) {
$name = "Unit-Test-".$this->randomName(8);
$ssh->create("dit", $name);
$response = $this->curlIt("http://".$server->hostname);
$this->assertTrue((strlen(response['raw']) > 0 && strpos($response['raw'], $name)), "Solr should list org the newly-created organization in its list.");
$ssh->destroy("dit", $name);
$response = $this->curlIt("http://".$server->hostname);
$this->assertFalse((strlen(response['raw']) > 0 && strpos($response['raw'], $name)), "Org should NOT be in the solr instance list.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment