@@ -17,7 +17,7 @@ class ArrayStructureTest extends TestBase
17
17
public function setUp ()
18
18
{
19
19
$ this ->class = new ArrayStructureElement ();
20
- $ this ->reflection = new \ReflectionClass ('PHPDraft\Model\DataStructureElement ' );
20
+ $ this ->reflection = new \ReflectionClass ('PHPDraft\Model\Elements\ArrayStructureElement ' );
21
21
}
22
22
23
23
public function tearDown ()
@@ -26,56 +26,13 @@ public function tearDown()
26
26
unset($ this ->reflection );
27
27
}
28
28
29
- //
30
29
/**
31
- // * Parse different objects
32
- // *
33
- // * @dataProvider parseObjectProvider
34
- // *
35
- // * @param string $object JSON Object
36
- // * @param ArrayStructureElement $expected Expected Object output
37
- // */
38
- // public function testSuccesfulParse($object, $expected)
39
- // {
40
- // $dep = [];
41
- // $this->class->parse(json_decode($object), $dep);
42
- // $this->assertSame($this->class->key, $expected->key);
43
- // $this->assertSame($this->class->value, $expected->value);
44
- // $this->assertSame($this->class->element, $expected->element);
45
- // $this->assertSame($this->class->type, $expected->type);
46
- // }
47
- /**
48
- * Provide objects to parse including expected outcome
49
- *
50
- * @return array
30
+ * Test if the value the class is initialized with is correct
51
31
*/
52
- public function parseObjectProvider ()
32
+ public function testSetupCorrectly ()
53
33
{
54
- $ return = [];
55
- $ base1 = new ArrayStructureElement ();
56
- $ base1 ->key = 'Content-Type ' ;
57
- $ base1 ->value = 'application/json ' ;
58
- $ base1 ->element = 'member ' ;
59
- $ base1 ->type = 'Struct2 ' ;
60
-
61
- $ base2 = new ArrayStructureElement ();
62
- $ base2 ->key = 'Auth2 ' ;
63
- $ base2 ->value = 'something ' ;
64
- $ base2 ->element = 'member ' ;
65
- $ base2 ->type = 'Struct1 ' ;
66
-
67
- // $return[] = [
68
- // '{"element": "member", "meta": { "description": "Files to be added. Need to be downloaded from the server. Contains relative paths"},
69
- // "attributes": { "typeAttributes": ["required"]},"content": {"key": {"element": "string","content": "add"},"value": {"element": "array"}}}',
70
- // $base1,
71
- // ];
72
- // $return[] = [
73
- // '{"element":"member","meta":{"description":"A json array of categories associated with the item"},"attributes":{"typeAttributes":["required"]},
74
- // "content":{"key":{"element":"string","content":"categoryIds"},"value":{"element":"array","content":[{"element":"string",
75
- // "content":"\"[\"111\",\"222\",\"333\"]\""}]}}}',
76
- // $base2,
77
- // ];
78
-
79
- return $ return ;
34
+ $ property = $ this ->reflection ->getProperty ('element ' );
35
+ $ property ->setAccessible (TRUE );
36
+ $ this ->assertNull ($ property ->getValue ($ this ->class ));
80
37
}
81
38
}
0 commit comments