-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDataSetStructTest.php
73 lines (70 loc) · 1.98 KB
/
DataSetStructTest.php
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
/**
* A PHP client library for accessing Comindware Tracker API.
*
* @copyright 2016, Comindware, http://comindware.com/
* @license http://opensource.org/licenses/MIT MIT
*/
namespace Comindware\Tracker\API\Tests\Struct;
use Comindware\Tracker\API\Struct\DataSetStruct;
/**
* Tests for Comindware\Tracker\API\Struct\DataSetStruct.
*
* @covers Comindware\Tracker\API\Struct\DataSetStruct
*/
class DataSetStructTest extends \PHPUnit_Framework_TestCase
{
public function testExportItems()
{
$data = [
'columns' => [
[
'datasourceId' => 'id',
'dataType' => 'Instance',
'name' => 'Identifier',
'isMultiValue' => false
],
[
'datasourceId' => 'name',
'dataType' => 'Undefined',
'isMultiValue' => false
]
],
'rows' => [
[
'isRead' => false,
'data' => [
'foo.1',
'Foo'
],
'isExpired' => false
],
[
'isRead' => false,
'data' => [
'foo.2',
'Bar'
],
'isExpired' => false
],
[
'isRead' => false,
'data' => [
'foo.3',
'Baz'
],
'isExpired' => false
]
]
];
$dataSet = new DataSetStruct($data);
static::assertEquals(
[
['id' => 'foo.1', 'name' => 'Foo'],
['id' => 'foo.2', 'name' => 'Bar'],
['id' => 'foo.3', 'name' => 'Baz']
],
$dataSet->exportItems()
);
}
}