Skip to content

Commit

Permalink
Add unit and functional test to check if coverage is reported correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
ruflin committed Jul 7, 2015
1 parent 001d049 commit e2eba3f
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/lib/Elastica/Test/Query/QueryStringTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,33 @@ public function testSetTimezone()
$this->assertEquals($expected, $query->toArray());
$this->assertInstanceOf('Elastica\Query\QueryString', $query->setTimezone($timezone));
}

/**
* @group unit
*/
public function testSetPhraseSlop()
{
$phraseSlop = 9;

$query = new QueryString("test");
$query->setPhraseSlop($phraseSlop);

$data = $query->toArray();
$this->assertEquals($phraseSlop, $data['query_string']['phrase_slop']);
}

/**
* @group functional
*/
public function testSetBoost()
{

$index = $this->_createIndex();
$query = new QueryString('test');
$query->setBoost(1.0);

$resultSet = $index->search($query);

$this->assertEquals(0, $resultSet->count());
}
}

0 comments on commit e2eba3f

Please sign in to comment.