Phalcon\Test\Unit\Http\Request\FileTest::testRealType PHP Method

testRealType() public method

Tests getRealType
Since: 2013-10-26
Author: Serghei Iakovlev ([email protected])
Author: Dreamszhu ([email protected])
public testRealType ( )
    public function testRealType()
    {
        if (!extension_loaded('fileinfo')) {
            $this->markTestSkipped('Warning: fileinfo extension is not loaded');
        }
        $this->specify("getRealType does not returns real type", function () {
            $file = new File(['name' => 'test', 'type' => 'text/plain', 'tmp_name' => PATH_DATA . '/assets/phalconphp.jpg', 'size' => 1, 'error' => 0]);
            expect($file->getType())->equals('text/plain');
            expect($file->getRealType())->equals('image/jpeg');
        });
    }