Skip to content

Commit

Permalink
[TEST] Remove ignored tests
Browse files Browse the repository at this point in the history
  • Loading branch information
polyfractal committed Nov 6, 2014
1 parent 5e63662 commit 693ceec
Showing 1 changed file with 0 additions and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,107 +46,4 @@ public function test5xxErrorBadHost()
$ret = $connection->performRequest('GET', '/');

}


/**
* @group ignore
*/
public function test4xxErrorNonexistantEndpoint()
{
$hostDetails = array('host' => 'localhost', 'port' => 9200);
$connectionParams['guzzleClient'] = new Client();
$log = m::mock('\Monolog\Logger')
->shouldReceive('debug')
->times(6)->getMock()
->shouldReceive('info')
->times(4)->getMock();

$connection = new GuzzleConnection($hostDetails, $connectionParams, $log, $log);
$ret = $connection->performRequest('GET', '/abc');

$this->assertEquals(400, $ret['status']);

}

/**
* @group ignore
*/
public function testQueryParams()
{
$hostDetails = array('host' => 'localhost', 'port' => 9200);
$connectionParams['guzzleClient'] = new Client();
$log = m::mock('\Monolog\Logger')
->shouldReceive('debug')
->times(3)->getMock()
->shouldReceive('info')
->times(2)->getMock();

$connection = new GuzzleConnection($hostDetails, $connectionParams, $log, $log);
$params['pretty'] = 'true';

$ret = $connection->performRequest('GET', '/', $params);

$this->assertEquals(200, $ret['status']);

$expectedURI = 'http://localhost:9200/?pretty=true';
$this->assertEquals($expectedURI, $ret['info']['url']);

}

/**
* @group ignore
*/
public function testQueryURI()
{
$hostDetails = array('host' => 'localhost', 'port' => 9200);
$connectionParams['guzzleClient'] = new Client();
$log = m::mock('\Monolog\Logger')
->shouldReceive('debug')
->times(3)->getMock()
->shouldReceive('info')
->times(2)->getMock();

$connection = new GuzzleConnection($hostDetails, $connectionParams, $log, $log);

$ret = $connection->performRequest('GET', '/_cluster/nodes/');

$expectedURI = 'http://localhost:9200/_cluster/nodes/';
$this->assertEquals($expectedURI, $ret['info']['url']);

}

/**
* @group ignore
*/
public function test4xxErrorInvalidIndexAndQueryBody()
{
$hostDetails = array('host' => 'localhost', 'port' => 9200);
$connectionParams['guzzleClient'] = new Client();
$log = m::mock('\Monolog\Logger')
->shouldReceive('debug')
->times(6)->getMock()
->shouldReceive('info')
->times(4)->getMock();

$connection = new GuzzleConnection($hostDetails, $connectionParams, $log, $log);

$body = '{"testsetting":"123"}';

/*
The index _doesnotexist is used with an underscore
because ES won't create it...invalid.
*/

$ret = $connection->performRequest('POST', '/_doesnotexist', null, $body);

$this->assertEquals(400, $ret['status']);

$expectedURI = 'http://localhost:9200/_doesnotexist';
$this->assertEquals($expectedURI, $ret['info']['url']);

// Best we can do to make sure the post actually posted.
$this->assertEquals(strlen(($body)), $ret['info']['size_upload']);


}
}

0 comments on commit 693ceec

Please sign in to comment.