Unit (real unit test) of test laravel relationship
PHP Snippet 1:
/** @test */
public function a_product_can_access_its_associated_user()
{
//Setup
$product = Product::factory()
->for(User::factory()->create())
->create();
//Executing & Asserting
$this->assertTrue($product->user()->exists());
}