Skip to content

Commit

Permalink
fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
portey committed Feb 25, 2016
1 parent e81cc5a commit 330c262
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Tests/DataProvider/TestScalarDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ public static function getDatetimeTestData()
];
}

public static function getDatetimetzTestData()
{
return [
[null, null, false],
];
}

public static function getDateTestData()
{
return [
Expand Down
10 changes: 9 additions & 1 deletion Tests/Type/ScalarTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@ class ScalarTypeTest extends \PHPUnit_Framework_TestCase
public function testScalarPrimitives()
{
foreach (TypeMap::getScalarTypes() as $typeName) {
$className = 'Youshido\GraphQL\Type\Scalar\\' . (ucfirst($typeName) == 'Datetime' ? 'DateTime' : ucfirst($typeName)) . 'Type';
$typeName = ucfirst($typeName);
if ($typeName == 'Datetime') {
$className = 'Youshido\GraphQL\Type\Scalar\DateTimeType';// : ;
} elseif ($typeName == 'Datetimetz') {
$className = 'Youshido\GraphQL\Type\Scalar\DateTimeTzType';
} else {
$className = 'Youshido\GraphQL\Type\Scalar\\' . ucfirst($typeName) . 'Type';
}

/** @var TypeInterface $object */
$object = new $className();
$testDataMethod = 'get' . $typeName . 'TestData';
Expand Down

0 comments on commit 330c262

Please sign in to comment.