Skip to content

Commit c0e5c24

Browse files
committed
Cleanup GraphNodeTest
1 parent 0673ccd commit c0e5c24

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

tests/GraphNode/GraphNodeTest.php

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function testAGraphNodeCanInstantiateWithData()
4646
/**
4747
* @dataProvider provideDateTimeFieldNames
4848
*/
49-
public function testIsCastDateTimeFieldsToDateTime($fieldName)
49+
public function testCastDateTimeFieldsToDateTime($fieldName)
5050
{
5151
$graphNode = new GraphNode([$fieldName => '1989-11-02']);
5252

@@ -69,7 +69,7 @@ public static function provideDateTimeFieldNames()
6969
/**
7070
* @dataProvider provideValidDateTimeFieldValues
7171
*/
72-
public function testIsCastDateTimeFieldValueToDateTime($value, $message, $prettyDate = null)
72+
public function testCastDateTimeFieldValueToDateTime($value, $message, $prettyDate = null)
7373
{
7474
$graphNode = new GraphNode(['created_time' => $value]);
7575

@@ -93,7 +93,7 @@ public static function provideValidDateTimeFieldValues()
9393
/**
9494
* @dataProvider provideInvalidDateTimeFieldValues
9595
*/
96-
public function testIsNotCastDateTimeFieldValueToDateTime($value, $message)
96+
public function testNotCastDateTimeFieldValueToDateTime($value, $message)
9797
{
9898
$graphNode = new GraphNode(['created_time' => $value]);
9999

@@ -130,23 +130,23 @@ public function testGettingAGraphNodeAsAStringWillSafelyRepresentDateTimes()
130130
$this->assertEquals('{"id":"123","created_time":"2014-07-15T03:44:53+0000"}', $graphNodeAsString);
131131
}
132132

133-
public function testAnExistingPropertyCanBeAccessed()
133+
public function testAnExistingFieldCanBeAccessed()
134134
{
135135
$graphNode = new GraphNode(['foo' => 'bar']);
136136

137137
$field = $graphNode->getField('foo');
138138
$this->assertEquals('bar', $field);
139139
}
140140

141-
public function testAMissingPropertyWillReturnNull()
141+
public function testAMissingFieldWillReturnNull()
142142
{
143143
$graphNode = new GraphNode(['foo' => 'bar']);
144144
$field = $graphNode->getField('baz');
145145

146146
$this->assertNull($field, 'Expected the property to return null.');
147147
}
148148

149-
public function testAMissingPropertyWillReturnTheDefault()
149+
public function testAMissingFieldWillReturnTheDefault()
150150
{
151151
$graphNode = new GraphNode(['foo' => 'bar']);
152152

@@ -168,22 +168,16 @@ public function testFalseDefaultsWillReturnSameType()
168168
$this->assertFalse($field);
169169
}
170170

171-
public function testTheKeysFromTheCollectionCanBeReturned()
171+
public function testTheFieldsFromTheGraphNodeCanBeReturned()
172172
{
173173
$graphNode = new GraphNode([
174-
'key1' => 'foo',
175-
'key2' => 'bar',
176-
'key3' => 'baz',
174+
'field1' => 'foo',
175+
'field2' => 'bar',
176+
'field3' => 'baz',
177177
]);
178178

179179
$fieldNames = $graphNode->getFieldNames();
180-
$this->assertEquals(['key1', 'key2', 'key3'], $fieldNames);
181-
}
182-
183-
public function testAnArrayCanBeInjectedViaTheConstructor()
184-
{
185-
$graphNode = new GraphNode(['foo', 'bar']);
186-
$this->assertEquals(['foo', 'bar'], $graphNode->asArray());
180+
$this->assertEquals(['field1', 'field2', 'field3'], $fieldNames);
187181
}
188182

189183
public function testAGraphNodeCanBeConvertedToAString()
@@ -195,15 +189,15 @@ public function testAGraphNodeCanBeConvertedToAString()
195189
$this->assertEquals('["foo","bar",123]', $graphNodeAsString);
196190
}
197191

198-
public function testACollectionCanBeAccessedAsAnArray()
192+
public function testAGraphNodeCanBeAccessedAsAnArray()
199193
{
200194
$graphNode = new GraphNode(['foo' => 'bar', 'faz' => 'baz']);
201195

202196
$this->assertEquals('bar', $graphNode['foo']);
203197
$this->assertEquals('baz', $graphNode['faz']);
204198
}
205199

206-
public function testACollectionCanBeIteratedOver()
200+
public function testAGraphNodeCanBeIteratedOver()
207201
{
208202
$graphNode = new GraphNode(['foo' => 'bar', 'faz' => 'baz']);
209203

0 commit comments

Comments
 (0)