Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 06e1d5d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/TestCase/View/Helper/FormHelperTest.php
Expand Up @@ -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' => ''],
Expand Down Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 06e1d5d

Please sign in to comment.