Skip to content

Commit

Permalink
Add test for Birthday cast
Browse files Browse the repository at this point in the history
  • Loading branch information
yguedidi committed Dec 19, 2017
1 parent cd9a2f2 commit 8c1c885
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/GraphNode/GraphNodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/
namespace Facebook\Tests\GraphNode;

use Facebook\GraphNode\Birthday;
use Facebook\GraphNode\GraphNode;
use PHPUnit\Framework\TestCase;

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

public function testCastBirthdayFieldValueToBirthday()
{
$graphNode = new GraphNode(['birthday' => '11/02/1989']);

$this->assertInstanceOf(Birthday::class, $graphNode->getField('birthday'));
}

public function testGettingGraphNodeAsAnArrayWillNotUncastTheDateTimeObject()
{
$graphNode = new GraphNode([
Expand Down

0 comments on commit 8c1c885

Please sign in to comment.