Set an order on metrics via the API. Closes #1874

This commit is contained in:
James Brooks
2016-06-02 09:06:40 +01:00
parent 439ac9fe44
commit cab030237b
12 changed files with 106 additions and 17 deletions
@@ -29,15 +29,16 @@ class AddMetricCommandTest extends AbstractTestCase
protected function getObjectAndParams()
{
$params = [
'name' => 'Coffee',
'suffix' => 'cups',
'description' => 'Cups of coffee consumed',
'default_value' => 0,
'calc_type' => 0,
'display_chart' => 1,
'places' => 0,
'default_view' => 0,
'threshold' => 0,
'name' => 'Coffee',
'suffix' => 'cups',
'description' => 'Cups of coffee consumed',
'default_value' => 0,
'calc_type' => 0,
'display_chart' => 1,
'places' => 0,
'default_view' => 0,
'threshold' => 0,
'order' => 0,
];
$object = new AddMetricCommand(
@@ -49,7 +50,8 @@ class AddMetricCommandTest extends AbstractTestCase
$params['display_chart'],
$params['places'],
$params['default_view'],
$params['threshold']
$params['threshold'],
$params['order']
);
return compact('params', 'object');
@@ -40,6 +40,7 @@ class UpdateMetricCommandTest extends AbstractTestCase
'places' => 0,
'default_view' => 0,
'threshold' => 0,
'order' => 0,
];
$object = new UpdateMetricCommand(
@@ -52,7 +53,8 @@ class UpdateMetricCommandTest extends AbstractTestCase
$params['display_chart'],
$params['places'],
$params['default_view'],
$params['threshold']
$params['threshold'],
$params['order']
);
return compact('params', 'object');