Skip to content
This repository was archived by the owner on Feb 10, 2019. It is now read-only.

Commit 5a4896f

Browse files
committed
add InputMakeCommandTest
1 parent dae386e commit 5a4896f

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

tests/Console/ExampleInput.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace App\GraphQL\Inputs;
4+
5+
use GraphQL\Type\Definition\Type;
6+
use Folklore\GraphQL\Support\InputType;
7+
use GraphQL;
8+
9+
class ExampleInput extends InputType
10+
{
11+
protected $attributes = [
12+
'name' => 'ExampleInput',
13+
'description' => 'An input'
14+
];
15+
16+
public function fields()
17+
{
18+
return [
19+
20+
];
21+
}
22+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
use Folklore\GraphQL\Console\InputMakeCommand;
4+
use Orchestra\Testbench\TestCase as BaseTestCase;
5+
6+
class InputMakeCommandTest extends BaseTestCase
7+
{
8+
protected function getPackageProviders($app)
9+
{
10+
return [
11+
\Folklore\GraphQL\ServiceProvider::class,
12+
];
13+
}
14+
15+
/** @test */
16+
public function it_makes_an_input_file()
17+
{
18+
$this->artisan('make:graphql:input', [
19+
'name' => 'ExampleInput',
20+
]);
21+
22+
$this->assertFileExists(app_path('GraphQL/Inputs') . '/ExampleInput.php');
23+
$this->assertFileEquals(app_path('GraphQL/Inputs') . '/ExampleInput.php', __DIR__ . '/ExampleInput.php');
24+
}
25+
}

0 commit comments

Comments
 (0)