-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathBaseTypeTest.php
More file actions
53 lines (43 loc) · 1.28 KB
/
BaseTypeTest.php
File metadata and controls
53 lines (43 loc) · 1.28 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
declare(strict_types=1);
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
namespace Elastic\Tests\Types;
use \Elastic\Tests\BaseTestCase;
use Elastic\Types\Tracing;
use Elastic\Types\BaseType;
/**
* Test: BaseType
*
* @version v1.x
*
* @see Elastic\Types\BaseType
*
* @author Philip Krauss <philip.krauss@elastic.co>
*/
class BaseTypeTest extends BaseTestCase
{
/**
* @covers Elastic\Types\BaseType::toArray
*/
public function testToArray()
{
$tracing = new Tracing($this->generateTraceId(), $this->generateTransactionId());
$this->assertInstanceOf(BaseType::class, $tracing);
$arr1 = $tracing->toArray();
$arr2 = $tracing->jsonSerialize();
$this->assertEquals($arr1, $arr2);
}
/**
* @covers Elastic\Types\BaseType::__toString
*/
public function testToString()
{
$tracing = new Tracing($this->generateTraceId(), $this->generateTransactionId());
$this->assertInstanceOf(BaseType::class, $tracing);
$json1 = json_encode($tracing);
$json2 = $tracing->__toString();
$this->assertEquals($json1, $json2);
}
}