summaryrefslogtreecommitdiff
path: root/vendor/ruflin/elastica/test/lib/Elastica/Test/Bulk/ActionTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ruflin/elastica/test/lib/Elastica/Test/Bulk/ActionTest.php')
-rw-r--r--vendor/ruflin/elastica/test/lib/Elastica/Test/Bulk/ActionTest.php29
1 files changed, 13 insertions, 16 deletions
diff --git a/vendor/ruflin/elastica/test/lib/Elastica/Test/Bulk/ActionTest.php b/vendor/ruflin/elastica/test/lib/Elastica/Test/Bulk/ActionTest.php
index 178883a8..e4588e70 100644
--- a/vendor/ruflin/elastica/test/lib/Elastica/Test/Bulk/ActionTest.php
+++ b/vendor/ruflin/elastica/test/lib/Elastica/Test/Bulk/ActionTest.php
@@ -1,64 +1,61 @@
<?php
-
namespace Elastica\Test\Bulk;
use Elastica\Bulk\Action;
-use Elastica\Bulk;
-use Elastica\Client;
-use Elastica\Exception\Bulk\ResponseException;
use Elastica\Index;
use Elastica\Test\Base as BaseTest;
-use Elastica\Bulk\ResponseSet;
-use Elastica\Response;
use Elastica\Type;
class ActionTest extends BaseTest
{
+ /**
+ * @group unit
+ */
public function testAction()
{
$action = new Action();
$this->assertEquals('index', $action->getOpType());
$this->assertFalse($action->hasSource());
- $expected = '{"index":{}}' . "\n";
+ $expected = '{"index":{}}'."\n";
$this->assertEquals($expected, $action->toString());
$action->setIndex('index');
- $expected = '{"index":{"_index":"index"}}' . "\n";
+ $expected = '{"index":{"_index":"index"}}'."\n";
$this->assertEquals($expected, $action->toString());
$action->setType('type');
- $expected = '{"index":{"_index":"index","_type":"type"}}' . "\n";
+ $expected = '{"index":{"_index":"index","_type":"type"}}'."\n";
$this->assertEquals($expected, $action->toString());
$action->setId(1);
- $expected = '{"index":{"_index":"index","_type":"type","_id":1}}' . "\n";
+ $expected = '{"index":{"_index":"index","_type":"type","_id":1}}'."\n";
$this->assertEquals($expected, $action->toString());
$action->setRouting(1);
- $expected = '{"index":{"_index":"index","_type":"type","_id":1,"_routing":1}}' . "\n";
+ $expected = '{"index":{"_index":"index","_type":"type","_id":1,"_routing":1}}'."\n";
$this->assertEquals($expected, $action->toString());
- $client = new Client();
+ $client = $this->_getClient();
$index = new Index($client, 'index2');
$type = new Type($index, 'type2');
$action->setIndex($index);
- $expected = '{"index":{"_index":"index2","_type":"type","_id":1,"_routing":1}}' . "\n";
+ $expected = '{"index":{"_index":"index2","_type":"type","_id":1,"_routing":1}}'."\n";
$this->assertEquals($expected, $action->toString());
$action->setType($type);
- $expected = '{"index":{"_index":"index2","_type":"type2","_id":1,"_routing":1}}' . "\n";
+ $expected = '{"index":{"_index":"index2","_type":"type2","_id":1,"_routing":1}}'."\n";
$this->assertEquals($expected, $action->toString());
$action->setSource(array('user' => 'name'));
- $expected = '{"index":{"_index":"index2","_type":"type2","_id":1,"_routing":1}}' . "\n";
- $expected.= '{"user":"name"}' . "\n";
+ $expected = '{"index":{"_index":"index2","_type":"type2","_id":1,"_routing":1}}'."\n";
+ $expected .= '{"user":"name"}'."\n";
$this->assertEquals($expected, $action->toString());
$this->assertTrue($action->hasSource());