- try {
- $this->assertEquals(false, $oParams->getFloat('float3'));
- } catch (Exception $e) {
- $this->assertEquals($e->getMessage(), "Floating-point number expected for parameter 'float3'");
- }
-
- try {
- $this->assertEquals(false, $oParams->getFloat('float4'));
- } catch (Exception $e) {
- $this->assertEquals($e->getMessage(), "Floating-point number expected for parameter 'float4'");
- }
- $this->assertEquals(false, $oParams->getFloat('float5'));
- $this->assertEquals(false, $oParams->getFloat('float6')); // FIXME: should be 0 instead?
+ public function testGetFloatWithString()
+ {
+ $this->setExpectedException(Exception::class, "Floating-point number expected for parameter 'float5'");
+ (new ParameterParser(['float5' => 'a']))->getFloat('float5');