@@ 139-145 (lines=7) @@ | ||
136 | $this->assertEquals('{"id":"123","date":"2014-07-15T03:44:53+0000"}', $graphNodeAsString); |
|
137 | } |
|
138 | ||
139 | public function testAnExistingPropertyCanBeAccessed() |
|
140 | { |
|
141 | $graphNode = new GraphNode(['foo' => 'bar']); |
|
142 | ||
143 | $field = $graphNode->getField('foo'); |
|
144 | $this->assertEquals('bar', $field); |
|
145 | } |
|
146 | ||
147 | public function testAMissingPropertyWillReturnNull() |
|
148 | { |
|
@@ 147-153 (lines=7) @@ | ||
144 | $this->assertEquals('bar', $field); |
|
145 | } |
|
146 | ||
147 | public function testAMissingPropertyWillReturnNull() |
|
148 | { |
|
149 | $graphNode = new GraphNode(['foo' => 'bar']); |
|
150 | $field = $graphNode->getField('baz'); |
|
151 | ||
152 | $this->assertNull($field, 'Expected the property to return null.'); |
|
153 | } |
|
154 | ||
155 | public function testAMissingPropertyWillReturnTheDefault() |
|
156 | { |
|
@@ 155-161 (lines=7) @@ | ||
152 | $this->assertNull($field, 'Expected the property to return null.'); |
|
153 | } |
|
154 | ||
155 | public function testAMissingPropertyWillReturnTheDefault() |
|
156 | { |
|
157 | $graphNode = new GraphNode(['foo' => 'bar']); |
|
158 | ||
159 | $field = $graphNode->getField('baz', 'faz'); |
|
160 | $this->assertEquals('faz', $field); |
|
161 | } |
|
162 | ||
163 | public function testFalseDefaultsWillReturnSameType() |
|
164 | { |