Index: tests/t3lib/t3lib_divTest.php =================================================================== --- tests/t3lib/t3lib_divTest.php (revision 8132) +++ tests/t3lib/t3lib_divTest.php (working copy) @@ -1615,5 +1615,66 @@ $this->assertEquals('someFile', $fileInfo['filebody']); $this->assertEquals('png', $fileInfo['fileext']); } + + /** + * Values, that should prokove TRUE in t3lib_div::testInt() + * + * @return array + */ + public function validTestIntDataProvider() { + return array( + 'int' => array(32425), + 'negative int' => array(-32425), + 'largest int' => array(PHP_INT_MAX), + 'int as string' => array('32425'), + 'negative int as string' => array('-32425'), + 'zero' => array(0), + 'zero as string' => array('0'), + ); + } + + /** + * Checks if t3lib_div::testInt() returns true on valid values + * + * @test + * @see t3lib_div::testInt() + * @dataProvider validTestIntDataProvider + */ + public function checkTestIntReturnsTrue($int) { + $this->assertTrue(t3lib_div::testInt($int)); + } + + /** + * Values, that should prokove FALSE in t3lib_div::testInt() + * + * @return array + */ + public function invalidTestIntDataProvider() { + return array( + 'largest int plus one' => array(PHP_INT_MAX + 1), + 'largest int plus one as string' => array(PHP_INT_MAX . '1'), + 'string' => array('testInt'), + 'empty string' => array(''), + 'int in string' => array('5 times of testInt'), + 'int as string with leading zero' => array('01234'), + 'float' => array(3.14159), + 'float as string' => array('3.14159'), + 'null' => array(NULL), + 'empty array' => array(array()), + 'int in array' => array(array(32425)), + 'int as string in array' => array(array('32425')), + ); + } + + /** + * Checks if t3lib_div::testInt() returns false on invald values + * + * @test + * @see t3lib_div::testInt() + * @dataProvider invalidTestIntDataProvider + */ + public function checkTestIntReturnsFalse($int) { + $this->assertFalse(t3lib_div::testInt($int)); + } } ?> \ No newline at end of file