* 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:
@@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user