Location: PHPKode > projects > SolarPHP > solar-system-1.1.1/solar/source/solar/tests/Test/Solar/Filter/SanitizeInt.php
<?php
/**
 * 
 * Concrete class test.
 * 
 */
class Test_Solar_Filter_SanitizeInt extends Test_Solar_Filter_Abstract {
    
    /**
     * 
     * Configuration values.
     * 
     * @var array
     * 
     */
    protected $_Test_Solar_Filter_SanitizeInt = array(
    );
    
    /**
     * 
     * Test -- Forces the value to an integer.
     * 
     */
    public function testSanitizeInt()
    {
        $before = 'abc ... 123.45 ,.../';
        $after = $this->_filter->sanitizeInt($before);
        $this->assertSame($after, 12345);
        
        $before = 'a-bc .1. alkasldjf 23 aslk.45 ,.../';
        $after = $this->_filter->sanitizeInt($before);
        $this->assertSame($after, -12345);
        
        $before = '1E5';
        $after = $this->_filter->sanitizeInt($before);
        $this->assertSame($after, 100000);
    }
}
Return current item: SolarPHP