Model ticket link counterparts explicitly
This commit is contained in:
@@ -20,9 +20,9 @@ class TicketLinkTest extends TestCase
|
||||
use RefreshDatabase;
|
||||
|
||||
/**
|
||||
* Ensure the ticket link factory normalizes the stored source and target ticket ids.
|
||||
* Ensure the ticket link factory preserves the provided source and target direction.
|
||||
*/
|
||||
public function test_ticket_link_factory_normalizes_ticket_order(): void
|
||||
public function test_ticket_link_factory_preserves_ticket_direction(): void
|
||||
{
|
||||
$project = Project::factory()->create([
|
||||
'key' => 'CORE',
|
||||
@@ -61,8 +61,8 @@ class TicketLinkTest extends TestCase
|
||||
'ticket_link_type_id' => $ticketLinkType->id,
|
||||
]);
|
||||
|
||||
$this->assertSame($firstTicket->id, $ticketLink->source_ticket_id);
|
||||
$this->assertSame($secondTicket->id, $ticketLink->target_ticket_id);
|
||||
$this->assertSame($secondTicket->id, $ticketLink->source_ticket_id);
|
||||
$this->assertSame($firstTicket->id, $ticketLink->target_ticket_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,6 +22,7 @@ class TicketLinkTypeTest extends TestCase
|
||||
|
||||
$this->assertNotNull($ticketLinkType->project_id);
|
||||
$this->assertIsString($ticketLinkType->label);
|
||||
$this->assertSame($ticketLinkType->label, $ticketLinkType->counterpart_label);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -39,12 +40,14 @@ class TicketLinkTypeTest extends TestCase
|
||||
$this->assertDatabaseHas('ticket_link_types', [
|
||||
'project_id' => $coreProject->id,
|
||||
'label' => 'Relates to',
|
||||
'counterpart_label' => 'Relates to',
|
||||
'position' => 1,
|
||||
]);
|
||||
|
||||
$this->assertDatabaseHas('ticket_link_types', [
|
||||
'project_id' => $coreProject->id,
|
||||
'label' => 'Blocks',
|
||||
'counterpart_label' => 'Blocked by',
|
||||
'position' => 2,
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user