Skip to content

Commit 300ca0d

Browse files
committed
null driver tests
1 parent 202746a commit 300ca0d

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

tests/Drivers/NullDriverTest.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Newman\LaravelGraphQLTestUtils\Tests\Drivers;
6+
7+
use Newman\LaravelGraphQLTestUtils\Drivers\NullDriver;
8+
use Newman\LaravelGraphQLTestUtils\Tests\TestCase;
9+
10+
class NullDriverTest extends TestCase
11+
{
12+
public function test_it_returns_expected_url_prefix(): void
13+
{
14+
$this->assertNull($this->getDriver()->getUrlPrefix());
15+
}
16+
17+
public function test_it_returns_expected_http_method(): void
18+
{
19+
$this->assertNull($this->getDriver()->getHttpMethodForSchema('default'));
20+
$this->assertNull($this->getDriver()->getHttpMethodForSchema('postable'));
21+
}
22+
23+
private function getDriver(): NullDriver
24+
{
25+
return $this->app->make('laravel-graphql-utils-driver:null');
26+
}
27+
}

tests/GraphQLTestingTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ public function test_it_can_set_different_drivers(): void
1818

1919
$this->assertEquals('custom', GraphQLTesting::getDriverName());
2020

21+
GraphQLTesting::useNullDriver();
22+
23+
$this->assertEquals('null', GraphQLTesting::getDriverName());
24+
2125
GraphQLTesting::useRebing();
2226

2327
$this->assertEquals('rebing', GraphQLTesting::getDriverName());

0 commit comments

Comments
 (0)