Skip to content
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
Compare
Choose a tag to compare
@chrissm79 chrissm79 released this 22 Nov 14:58
· 110 commits to master since this 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'
        ]);
    }
}