support custom fields for timesheets, customers, projects and activities (#871)
This commit is contained in:
@@ -220,10 +220,12 @@ class ActivityControllerTest extends APIControllerBaseTest
|
||||
|
||||
protected function assertStructure(array $result, $full = true)
|
||||
{
|
||||
$expectedKeys = ['id', 'name', 'visible', 'project', 'hourlyRate', 'fixedRate', 'color'];
|
||||
$expectedKeys = ['id', 'name', 'visible', 'project', 'hourlyRate', 'fixedRate', 'color', 'metaFields'];
|
||||
|
||||
if ($full) {
|
||||
$expectedKeys = array_merge($expectedKeys, ['comment', 'budget', 'timeBudget']);
|
||||
$expectedKeys = array_merge($expectedKeys, [
|
||||
'comment', 'budget', 'timeBudget'
|
||||
]);
|
||||
}
|
||||
|
||||
$actual = array_keys($result);
|
||||
|
||||
@@ -163,7 +163,7 @@ class CustomerControllerTest extends APIControllerBaseTest
|
||||
|
||||
protected function assertStructure(array $result, $full = true)
|
||||
{
|
||||
$expectedKeys = ['id', 'name', 'visible', 'hourlyRate', 'fixedRate', 'color'];
|
||||
$expectedKeys = ['id', 'name', 'visible', 'hourlyRate', 'fixedRate', 'color', 'metaFields'];
|
||||
|
||||
if ($full) {
|
||||
$expectedKeys = array_merge($expectedKeys, [
|
||||
|
||||
@@ -212,14 +212,13 @@ class ProjectControllerTest extends APIControllerBaseTest
|
||||
protected function assertStructure(array $result, $full = true)
|
||||
{
|
||||
$expectedKeys = [
|
||||
'id', 'name', 'visible', 'customer', 'hourlyRate', 'fixedRate', 'color'
|
||||
'id', 'name', 'visible', 'customer', 'hourlyRate', 'fixedRate', 'color', 'metaFields'
|
||||
];
|
||||
|
||||
if ($full) {
|
||||
$expectedKeys = array_merge(
|
||||
$expectedKeys,
|
||||
['comment', 'budget', 'timeBudget', 'orderNumber']
|
||||
);
|
||||
$expectedKeys = array_merge($expectedKeys, [
|
||||
'comment', 'budget', 'timeBudget', 'orderNumber'
|
||||
]);
|
||||
}
|
||||
|
||||
$actual = array_keys($result);
|
||||
|
||||
@@ -819,7 +819,7 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
protected function assertDefaultStructure(array $result, $full = true)
|
||||
{
|
||||
$expectedKeys = [
|
||||
'id', 'begin', 'end', 'duration', 'description', 'rate', 'activity', 'project', 'tags', 'user'
|
||||
'id', 'begin', 'end', 'duration', 'description', 'rate', 'activity', 'project', 'tags', 'user', 'metaFields'
|
||||
];
|
||||
|
||||
if ($full) {
|
||||
|
||||
Reference in New Issue
Block a user