/** * test get content type */ public function testGetContentType() { $this->testCreateFile(); $contentType = $this->_controller->getContentType($this->_basePath . '/PHPUNIT/phpunit.txt'); // finfo_open() for content type detection is only available in php versions >= 5.3.0' $expectedContentType = version_compare(PHP_VERSION, '5.3.0', '>=') && function_exists('finfo_open') ? 'text/plain' : 'application/octet-stream'; $this->assertEquals($expectedContentType, $contentType); }