'link']); $this->assertTrue($doc->isLink()); } public function test_is_link_returns_false_when_tipo_is_upload(): void { $doc = new Documento(['tipo' => 'upload']); $this->assertFalse($doc->isLink()); } public function test_is_link_returns_false_when_tipo_is_allegato(): void { $doc = new Documento(['tipo' => 'allegato']); $this->assertFalse($doc->isLink()); } public function test_is_link_returns_false_when_tipo_is_null(): void { $doc = new Documento(); $this->assertFalse($doc->isLink()); } public function test_url_is_fillable(): void { $doc = new Documento(['url' => 'https://example.com/doc']); $this->assertEquals('https://example.com/doc', $doc->url); } public function test_link_doc_has_no_file_fields(): void { $doc = new Documento([ 'tipo' => 'link', 'url' => 'https://example.com/doc', 'file_path' => null, 'mime_type' => null, 'dimensione' => null, ]); $this->assertNull($doc->file_path); $this->assertNull($doc->mime_type); $this->assertNull($doc->dimensione); $this->assertTrue($doc->isLink()); } }