This repository has been archived by the owner on Mar 29, 2020. It is now read-only.
Added mutation test helper
Pre-release
Pre-release
Helper trait that allows you to easily test mutations:
<?php
use Nuwave\Relay\Traits\MutationTestTrait;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class CreateUserMutationTest extends TestCase
{
use DatabaseTransactions, MutationTestTrait;
/**
* @test
*/
public function itCanCreateANewUser()
{
$this->mutate('createUser', [
'firstName' => 'John',
'lastName' => 'Doe',
'email' => '[email protected]',
'password' => 'foobar',
'password_confirmation' => 'foobar'
])->seeJson([
'firstName' => 'John',
'lastName' => 'Doe'
]);
}
}