Skip to content

Commit 8c1c885

Browse files
committed
Add test for Birthday cast
1 parent cd9a2f2 commit 8c1c885

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/GraphNode/GraphNodeTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
*/
2323
namespace Facebook\Tests\GraphNode;
2424

25+
use Facebook\GraphNode\Birthday;
2526
use Facebook\GraphNode\GraphNode;
2627
use PHPUnit\Framework\TestCase;
2728

@@ -106,6 +107,13 @@ public static function provideInvalidDateTimeFieldValues()
106107
yield ['foo_time', 'Expected the invalid ISO 8601 format to fail.'];
107108
}
108109

110+
public function testCastBirthdayFieldValueToBirthday()
111+
{
112+
$graphNode = new GraphNode(['birthday' => '11/02/1989']);
113+
114+
$this->assertInstanceOf(Birthday::class, $graphNode->getField('birthday'));
115+
}
116+
109117
public function testGettingGraphNodeAsAnArrayWillNotUncastTheDateTimeObject()
110118
{
111119
$graphNode = new GraphNode([

0 commit comments

Comments
 (0)