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