Skip to content

Commit 774e4b8

Browse files
committed
test: enhance ContactRelationRequestsTest to create and attach a new Contact for testing
1 parent 456aeb9 commit 774e4b8

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

tests/Resources/Contacts/ContactRelations/ContactRelationRequestsTest.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,24 @@
33
namespace Bexio\Resources\Contacts\ContactRelations\Requests;
44

55
use Bexio\Resources\Contacts\ContactRelations\ContactRelation;
6+
use Bexio\Resources\Contacts\Contacts\Contact;
7+
use Bexio\Resources\Contacts\Contacts\Enums\ContactType;
68
use Bexio\Support\Data\SearchCriteria;
79
use function Pest\Faker\fake;
810

911
$testRelation = null;
1012

1113
it('can create a ContactRelation', function () use (&$testRelation) {
14+
$connectToContact = new Contact(
15+
contact_type_id: ContactType::PERSON,
16+
name_1: fake()->firstName(),
17+
name_2: fake()->lastName(),
18+
);
19+
$connectToContact = $connectToContact->attachClient(testClient())->save();
20+
1221
$relation = new ContactRelation(
13-
contact_id: 1,
14-
contact_sub_id: 2,
22+
contact_id: testContactId(),
23+
contact_sub_id: $connectToContact->id,
1524
description: fake()->sentence(),
1625
);
1726

0 commit comments

Comments
 (0)