Skip to content
Permalink
Browse files

Forward port tests from #7500

Add tests for decimal with no precision/scale to 3.x showing that it
behaves properly.
  • Loading branch information...
markstory committed Oct 3, 2015
1 parent e38b626 commit 06e1d5d1feaa09fdfc713f5624159eda077821ec
Showing with 12 additions and 0 deletions.
  1. +12 −0 tests/TestCase/View/Helper/FormHelperTest.php
@@ -92,6 +92,7 @@ class ValidateUsersTable extends Table
'email' => ['type' => 'string', 'null' => '', 'default' => '', 'length' => '255'],
'balance' => ['type' => 'float', 'null' => false, 'length' => 5, 'precision' => 2],
'cost_decimal' => ['type' => 'decimal', 'null' => false, 'length' => 6, 'precision' => 3],
'null_decimal' => ['type' => 'decimal', 'null' => false, 'length' => null, 'precision' => null],
'ratio' => ['type' => 'decimal', 'null' => false, 'length' => 10, 'precision' => 6],
'population' => ['type' => 'decimal', 'null' => false, 'length' => 15, 'precision' => 0],
'created' => ['type' => 'date', 'null' => '1', 'default' => '', 'length' => ''],
@@ -2262,6 +2263,17 @@ public function testInput()
'/div',
];
$this->assertHtml($expected, $result);
$result = $this->Form->input('ValidateUser.null_decimal');
$expected = [
'div' => ['class'],
'label' => ['for'],
'Null Decimal',
'/label',
'input' => ['name', 'type' => 'number', 'id'],
'/div',
];
$this->assertHtml($expected, $result);
}
/**

0 comments on commit 06e1d5d

Please sign in to comment.
You can’t perform that action at this time.