Skip to content

Commit

Permalink
refactor: short array and code style
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Feb 12, 2018
1 parent 647cc7e commit 253013e
Showing 1 changed file with 82 additions and 82 deletions.
164 changes: 82 additions & 82 deletions tests/0005_Unit/FloatFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,88 +2,88 @@
class FloatFieldTest extends SuperAdminTestCase {

public function provider() {
$dataset = array(
array(
'fields' => array(
'fieldtype' => 'float',
'name' => 'question',
'required' => '0',
'default_values' => '',
'order' => '1',
'show_rule' => 'always',
'show_empty' => '0',
'values' => ''
),
'data' => null,
'expectedValue' => '',
'expectedIsValid' => true
),
array(
'fields' => array(
'fieldtype' => 'float',
'name' => 'question',
'required' => '0',
'default_values' => '2',
'order' => '1',
'show_rule' => 'always',
'show_empty' => '0',
'values' => ''
),
'data' => null,
'expectedValue' => '2',
'expectedIsValid' => true
),
array(
'fields' => array(
'fieldtype' => 'float',
'name' => 'question',
'required' => '0',
'default_values' => "2",
'order' => '1',
'show_rule' => 'always',
'show_empty' => '0',
'range_min' => 3,
'range_max' => 4,
),
'data' => null,
'expectedValue' => '2',
'expectedIsValid' => false
),
array(
'fields' => array(
'fieldtype' => 'float',
'name' => 'question',
'required' => '0',
'default_values' => "5",
'order' => '1',
'show_rule' => 'always',
'show_empty' => '0',
'values' => '',
'range_min' => 3,
'range_max' => 4,
),
'data' => null,
'expectedValue' => '5',
'expectedIsValid' => false
),
array(
'fields' => array(
'fieldtype' => 'float',
'name' => 'question',
'required' => '0',
'default_values' => "3.141592",
'order' => '1',
'show_rule' => 'always',
'show_empty' => '0',
'values' => '',
'range_min' => 3,
'range_max' => 4,
),
'data' => null,
'expectedValue' => '3.141592',
'expectedIsValid' => true
),
);
$dataset = [
[
'fields' => [
'fieldtype' => 'float',
'name' => 'question',
'required' => '0',
'default_values' => '',
'order' => '1',
'show_rule' => 'always',
'show_empty' => '0',
'values' => ''
],
'data' => null,
'expectedValue' => '',
'expectedIsValid' => true
],
[
'fields' => [
'fieldtype' => 'float',
'name' => 'question',
'required' => '0',
'default_values' => '2',
'order' => '1',
'show_rule' => 'always',
'show_empty' => '0',
'values' => ''
],
'data' => null,
'expectedValue' => '2',
'expectedIsValid' => true
],
[
'fields' => [
'fieldtype' => 'float',
'name' => 'question',
'required' => '0',
'default_values' => "2",
'order' => '1',
'show_rule' => 'always',
'show_empty' => '0',
'range_min' => 3,
'range_max' => 4,
],
'data' => null,
'expectedValue' => '2',
'expectedIsValid' => false
],
[
'fields' => [
'fieldtype' => 'float',
'name' => 'question',
'required' => '0',
'default_values' => "5",
'order' => '1',
'show_rule' => 'always',
'show_empty' => '0',
'values' => '',
'range_min' => 3,
'range_max' => 4,
],
'data' => null,
'expectedValue' => '5',
'expectedIsValid' => false
],
[
'fields' => [
'fieldtype' => 'float',
'name' => 'question',
'required' => '0',
'default_values' => "3.141592",
'order' => '1',
'show_rule' => 'always',
'show_empty' => '0',
'values' => '',
'range_min' => 3,
'range_max' => 4,
],
'data' => null,
'expectedValue' => '3.141592',
'expectedIsValid' => true
],
];

return $dataset;
}
Expand Down

0 comments on commit 253013e

Please sign in to comment.