From 469b90a86064a42b1034ccb774b80d237a7de06b Mon Sep 17 00:00:00 2001 From: Braden Keith Date: Tue, 25 Jan 2022 18:14:24 -0500 Subject: [PATCH] Improve stub --- src/Commands/stubs/ResourceTest.stub | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Commands/stubs/ResourceTest.stub b/src/Commands/stubs/ResourceTest.stub index f6b4e37..9dba5be 100644 --- a/src/Commands/stubs/ResourceTest.stub +++ b/src/Commands/stubs/ResourceTest.stub @@ -58,7 +58,9 @@ class DummyClass extends NovaResourceTestCase */ public function it_fails_to_store_this_resource_without_all_required_fields($saveMethod) { - $this->setNullValuesOn($required = []) + $this->setNullValuesOn($required = [ + 'name', + ]) ->$saveMethod() ->assertRequiredFields($required) ->assertNovaFailed(); @@ -67,7 +69,9 @@ class DummyClass extends NovaResourceTestCase /** @test */ public function it_can_update_this_resource() { - $response = $this->updateResource(['name' => $name = 'Vader']) + $response = $this->updateResource([ + 'name' => $name = 'Vader', + ]) ->assertOk(); $this->assertDatabaseHas((new {{ modelName }})->getTable(), [ @@ -83,6 +87,14 @@ class DummyClass extends NovaResourceTestCase ->assertOk(); } + /** @test **/ + public function it_has_relationships() + { + // $this->assertHasManyRelationships([ + // 'product', + // ]); + } + public function storeMethodProvider() { return [