factory()->for($this->user)->create(); } /** * @doesNotPerformAssertions */ public function testCanViewInstance(): void { $this->setName('can *not* view instance'); // Journal entries are not independently viewable. } /** * @doesNotPerformAssertions */ public function testCanEditInstance(): void { $this->setName('can *not* edit instance'); // Journal entries are not editable. } public function testCanAddInstance(): void { $create_url = action([$this->class(), 'createFromNutrients']); $response = $this->get($create_url); $response->assertOk(); $instance = $this->factory()->make(); $store_url = action([$this->class(), 'storeFromNutrients']); $response = $this->post($store_url, $instance->toArray()); $response->assertSessionHasNoErrors(); } }