Skip to content

Commit

Permalink
Update tests after adding 'text' property to Custom Fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelrs committed Feb 18, 2022
1 parent f8468ca commit 7eb8c61
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/Conversations/ConversationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ public function testExtract()
$this->assertInstanceOf(CustomField::class, $customField->setId(936));
$this->assertInstanceOf(CustomField::class, $customField->setName('Account Type'));
$customField->setValue('Administrator');
$customField->setText('Administrator');
$conversation->setCustomFields(new Collection([
$customField,
]));
Expand Down Expand Up @@ -349,6 +350,7 @@ public function testExtract()
'id' => 936,
'name' => 'Account Type',
'value' => 'Administrator',
'text' => 'Administrator',
]],
$extractedConversation['fields']
);
Expand Down
6 changes: 6 additions & 0 deletions tests/Conversations/CustomFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ public function testHydrate()
'id' => 6688,
'name' => 'Account Type',
'value' => 'Premium',
'text' => 'Premium',
]);

$this->assertSame(6688, $customField->getId());
$this->assertSame('Account Type', $customField->getName());
$this->assertSame('Premium', $customField->getValue());
$this->assertSame('Premium', $customField->getText());
}

public function testExtract()
Expand All @@ -29,11 +31,13 @@ public function testExtract()
$this->assertInstanceOf(CustomField::class, $customField->setId(6688));
$this->assertInstanceOf(CustomField::class, $customField->setName('Account Type'));
$this->assertInstanceOf(CustomField::class, $customField->setValue('Premium'));
$this->assertInstanceOf(CustomField::class, $customField->setText('Premium'));

$this->assertSame([
'id' => 6688,
'name' => 'Account Type',
'value' => 'Premium',
'text' => 'Premium',
], $customField->extract());
}

Expand All @@ -48,6 +52,7 @@ public function testExtractFormatsDateTime()
'id' => 6688,
'name' => 'Account Type',
'value' => '2017-01-02',
'text' => null,
], $customField->extract());
}

Expand All @@ -59,6 +64,7 @@ public function testExtractNewEntity()
'id' => null,
'name' => null,
'value' => null,
'text' => null,
], $customField->extract());
}
}
2 changes: 2 additions & 0 deletions tests/Conversations/CustomFieldsCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function testExtract()
$customField->setId(936);
$customField->setName('Account Type');
$customField->setValue('Administrator');
$customField->setText('Administrator');

$customFieldsCollection->setCustomFields([
$customField,
Expand All @@ -29,6 +30,7 @@ public function testExtract()
'id' => 936,
'name' => 'Account Type',
'value' => 'Administrator',
'text' => 'Administrator',
],
],
], $customFieldsCollection->extract());
Expand Down

0 comments on commit 7eb8c61

Please sign in to comment.