summaryrefslogtreecommitdiff
path: root/vendor/ruflin/elastica/test/lib/Elastica/Test/Query/WildcardTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ruflin/elastica/test/lib/Elastica/Test/Query/WildcardTest.php')
-rw-r--r--vendor/ruflin/elastica/test/lib/Elastica/Test/Query/WildcardTest.php39
1 files changed, 22 insertions, 17 deletions
diff --git a/vendor/ruflin/elastica/test/lib/Elastica/Test/Query/WildcardTest.php b/vendor/ruflin/elastica/test/lib/Elastica/Test/Query/WildcardTest.php
index 077e6d4f..7a0c379e 100644
--- a/vendor/ruflin/elastica/test/lib/Elastica/Test/Query/WildcardTest.php
+++ b/vendor/ruflin/elastica/test/lib/Elastica/Test/Query/WildcardTest.php
@@ -1,5 +1,4 @@
<?php
-
namespace Elastica\Test\Query;
use Elastica\Document;
@@ -9,12 +8,18 @@ use Elastica\Type\Mapping;
class WildcardTest extends BaseTest
{
+ /**
+ * @group unit
+ */
public function testConstructEmpty()
{
$wildcard = new Wildcard();
$this->assertEmpty($wildcard->getParams());
}
+ /**
+ * @group unit
+ */
public function testToArray()
{
$key = 'name';
@@ -27,14 +32,17 @@ class WildcardTest extends BaseTest
'wildcard' => array(
$key => array(
'value' => $value,
- 'boost' => $boost
- )
- )
+ 'boost' => $boost,
+ ),
+ ),
);
$this->assertEquals($expectedArray, $wildcard->toArray());
}
+ /**
+ * @group functional
+ */
public function testSearchWithAnalyzer()
{
$client = $this->_getClient();
@@ -46,10 +54,10 @@ class WildcardTest extends BaseTest
'lw' => array(
'type' => 'custom',
'tokenizer' => 'keyword',
- 'filter' => array('lowercase')
- )
+ 'filter' => array('lowercase'),
+ ),
),
- )
+ ),
);
$index->create($indexParams, true);
@@ -61,16 +69,13 @@ class WildcardTest extends BaseTest
);
$type->setMapping($mapping);
- $doc = new Document(1, array('name' => 'Basel-Stadt'));
- $type->addDocument($doc);
- $doc = new Document(2, array('name' => 'New York'));
- $type->addDocument($doc);
- $doc = new Document(3, array('name' => 'Baden'));
- $type->addDocument($doc);
- $doc = new Document(4, array('name' => 'Baden Baden'));
- $type->addDocument($doc);
- $doc = new Document(5, array('name' => 'New Orleans'));
- $type->addDocument($doc);
+ $type->addDocuments(array(
+ new Document(1, array('name' => 'Basel-Stadt')),
+ new Document(2, array('name' => 'New York')),
+ new Document(3, array('name' => 'Baden')),
+ new Document(4, array('name' => 'Baden Baden')),
+ new Document(5, array('name' => 'New Orleans')),
+ ));
$index->refresh();