* move common file-specific functionality out of IDF_Views_Source into new

IDF_FileUtil and change all occurrences accordingly
* cache /etc/mime.types (or whatever is configured) per request in a static
variable in IDF_FileUtil
* always link directly to the download of attached files in the issues view
and place an additional "view" link only for those attachments which we
recognize as text with our weak criteria (closes issue 575)
This commit is contained in:
Thomas Keller
2010-12-02 01:50:01 +01:00
parent 6d7d7ebbfa
commit dffeb1f9d5
9 changed files with 254 additions and 170 deletions

View File

@@ -32,19 +32,6 @@ class IDF_Tests_TestSource extends UnitTestCase
parent::__construct('Test the source class.');
}
public function testGetMimeType()
{
$files = array(
'whatever.php' => 'application/x-httpd-php',
'whatever.pht' => 'application/x-httpd-php',
'README' => 'text/plain',
);
foreach ($files as $file => $mime) {
$m = IDF_Views_Source::getMimeType($file);
$this->assertEqual($mime, $m[0]);
}
}
public function testRegexCommit()
{
$regex = '#^/p/([\-\w]+)/source/tree/([^\/]+)/(.*)$#';
@@ -61,4 +48,4 @@ class IDF_Tests_TestSource extends UnitTestCase
$this->assertEqual($res[2], $m[3]);
}
}
}
}