Skip to content

Commit

Permalink
Merge branch 'master' of http://github.com/fliglio/web into 2.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
benschw committed Jun 23, 2015
2 parents bd5cbbd + d7dfbe5 commit c32d6ab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Fliglio/Web/IntParam.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ public function __construct($val) {
'message' => 'The value {{ value }} is not a valid integer.'
]));
}
}
public function get() {
return (int)parent::get();
}
}
9 changes: 8 additions & 1 deletion test/IntParamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ public function testValid_IntegerString() {
$this->assertTrue(true);
}

public function testValid_IntegerStringIsInt() {
$param = new IntParam('34');
$param->validate();


$this->assertTrue(is_int($param->get()));
}
/**
* @expectedException Fliglio\Web\ValidationException
*/
Expand Down Expand Up @@ -51,4 +58,4 @@ public function testInvalid_Double() {
$param->validate();
}

}
}

0 comments on commit c32d6ab

Please sign in to comment.