CRUDlexTests\TwigExtensionsTest::testFormatFloat PHP Method

testFormatFloat() public method

public testFormatFloat ( )
    public function testFormatFloat()
    {
        $filter = $this->app['twig']->getFilter('float');
        $float = 4.0E-6;
        $read = call_user_func($filter->getCallable(), $float);
        $expected = '0.000004';
        $this->assertSame($expected, $read);
        $read = call_user_func($filter->getCallable(), null);
        $this->assertNull($read);
        $read = call_user_func($filter->getCallable(), 1.0);
        $expected = '1.0';
        $this->assertSame($expected, $read);
        $float = 0.004;
        $read = call_user_func($filter->getCallable(), $float);
        $expected = '0.004';
        $this->assertSame($expected, $read);
    }