X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FFormOptionsTest.php;h=665fa390171d2f6ea3cc04d656c518ff59d66985;hb=6ab14151766918b9c7abf33580cdd64b9f9e79e4;hp=08d6ba895644fef7d5609524ce9df24bd0d65164;hpb=5ba267d0ac62ed1a25c35036eb90156ec94361f0;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/FormOptionsTest.php b/tests/phpunit/includes/FormOptionsTest.php index 08d6ba8956..665fa39017 100644 --- a/tests/phpunit/includes/FormOptionsTest.php +++ b/tests/phpunit/includes/FormOptionsTest.php @@ -34,6 +34,7 @@ class FormOptionsTest extends MediaWikiTestCase { $this->object->add( 'string1', 'string one' ); $this->object->add( 'string2', 'string two' ); $this->object->add( 'integer', 0 ); + $this->object->add( 'float', 0.0 ); $this->object->add( 'intnull', 0, FormOptions::INTNULL ); } @@ -45,6 +46,9 @@ class FormOptionsTest extends MediaWikiTestCase { private function assertGuessInt( $data ) { $this->guess( FormOptions::INT, $data ); } + private function assertGuessFloat( $data ) { + $this->guess( FormOptions::FLOAT, $data ); + } private function assertGuessString( $data ) { $this->guess( FormOptions::STRING, $data ); } @@ -71,10 +75,15 @@ class FormOptionsTest extends MediaWikiTestCase { $this->assertGuessInt( 5 ); $this->assertGuessInt( 0x0F ); + $this->assertGuessFloat( 0.0 ); + $this->assertGuessFloat( 1.5 ); + $this->assertGuessFloat( 1e3 ); + $this->assertGuessString( 'true' ); $this->assertGuessString( 'false' ); $this->assertGuessString( '5' ); $this->assertGuessString( '0' ); + $this->assertGuessString( '1.5' ); } /**