blob: da15f0f2e38a8004de072fe66388b69d2b673b22 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
<?php
namespace Elastica\Test\Query;
use Elastica\Query\Term;
use Elastica\Test\Base as BaseTest;
class TermTest extends BaseTest
{
/**
* @group unit
*/
public function testToArray()
{
$query = new Term();
$key = 'name';
$value = 'nicolas';
$boost = 2;
$query->setTerm($key, $value, $boost);
$data = $query->toArray();
$this->assertInternalType('array', $data['term']);
$this->assertInternalType('array', $data['term'][$key]);
$this->assertEquals($data['term'][$key]['value'], $value);
$this->assertEquals($data['term'][$key]['boost'], $boost);
}
}
|