summaryrefslogtreecommitdiff
path: root/vendor/ruflin/elastica/test/lib/Elastica/Test/DocumentTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ruflin/elastica/test/lib/Elastica/Test/DocumentTest.php')
-rw-r--r--vendor/ruflin/elastica/test/lib/Elastica/Test/DocumentTest.php48
1 files changed, 44 insertions, 4 deletions
diff --git a/vendor/ruflin/elastica/test/lib/Elastica/Test/DocumentTest.php b/vendor/ruflin/elastica/test/lib/Elastica/Test/DocumentTest.php
index 27fc5184..969c5b22 100644
--- a/vendor/ruflin/elastica/test/lib/Elastica/Test/DocumentTest.php
+++ b/vendor/ruflin/elastica/test/lib/Elastica/Test/DocumentTest.php
@@ -1,20 +1,21 @@
<?php
-
namespace Elastica\Test;
use Elastica\Document;
use Elastica\Exception\InvalidException;
-use Elastica\Script;
use Elastica\Index;
-use Elastica\Type;
use Elastica\Test\Base as BaseTest;
+use Elastica\Type;
class DocumentTest extends BaseTest
{
+ /**
+ * @group unit
+ */
public function testAddFile()
{
$fileName = '/dev/null';
- if(!file_exists($fileName)){
+ if (!file_exists($fileName)) {
$this->markTestSkipped("File {$fileName} does not exist.");
}
$doc = new Document();
@@ -22,6 +23,9 @@ class DocumentTest extends BaseTest
$this->assertInstanceOf('Elastica\Document', $returnValue);
}
+ /**
+ * @group unit
+ */
public function testAddGeoPoint()
{
$doc = new Document();
@@ -29,6 +33,9 @@ class DocumentTest extends BaseTest
$this->assertInstanceOf('Elastica\Document', $returnValue);
}
+ /**
+ * @group unit
+ */
public function testSetData()
{
$doc = new Document();
@@ -36,6 +43,9 @@ class DocumentTest extends BaseTest
$this->assertInstanceOf('Elastica\Document', $returnValue);
}
+ /**
+ * @group unit
+ */
public function testToArray()
{
$id = 17;
@@ -49,6 +59,9 @@ class DocumentTest extends BaseTest
$this->assertEquals($result, $doc->toArray());
}
+ /**
+ * @group unit
+ */
public function testSetType()
{
$document = new Document();
@@ -68,6 +81,9 @@ class DocumentTest extends BaseTest
$this->assertEquals('type', $document->getType());
}
+ /**
+ * @group unit
+ */
public function testSetIndex()
{
$document = new Document();
@@ -85,6 +101,9 @@ class DocumentTest extends BaseTest
$this->assertEquals('type2', $document->getType());
}
+ /**
+ * @group unit
+ */
public function testHasId()
{
$document = new Document();
@@ -97,6 +116,9 @@ class DocumentTest extends BaseTest
$this->assertTrue($document->hasId());
}
+ /**
+ * @group unit
+ */
public function testGetOptions()
{
$document = new Document();
@@ -134,6 +156,9 @@ class DocumentTest extends BaseTest
$this->assertArrayNotHasKey('parent', $options);
}
+ /**
+ * @group unit
+ */
public function testGetSetHasRemove()
{
$document = new Document(1, array('field1' => 'value1', 'field2' => 'value2', 'field3' => 'value3', 'field4' => null));
@@ -185,6 +210,9 @@ class DocumentTest extends BaseTest
$this->assertNotEquals($data, $newData);
}
+ /**
+ * @group unit
+ */
public function testDataPropertiesOverloading()
{
$document = new Document(1, array('field1' => 'value1', 'field2' => 'value2', 'field3' => 'value3', 'field4' => null));
@@ -234,6 +262,9 @@ class DocumentTest extends BaseTest
$this->assertNotEquals($data, $newData);
}
+ /**
+ * @group unit
+ */
public function testSetTtl()
{
$document = new Document();
@@ -254,6 +285,9 @@ class DocumentTest extends BaseTest
$this->assertEquals('1d', $document->getTtl());
}
+ /**
+ * @group unit
+ */
public function testSerializedData()
{
$data = '{"user":"rolf"}';
@@ -283,6 +317,9 @@ class DocumentTest extends BaseTest
}
}
+ /**
+ * @group unit
+ */
public function testUpsert()
{
$document = new Document();
@@ -298,6 +335,9 @@ class DocumentTest extends BaseTest
$this->assertSame($upsert, $document->getUpsert());
}
+ /**
+ * @group unit
+ */
public function testDocAsUpsert()
{
$document = new Document();