2015-10-28 02:53:27 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* this file contains tests for the uploader
|
2016-10-12 19:50:49 +00:00
|
|
|
*
|
2015-10-28 02:53:27 +00:00
|
|
|
* @package test.util
|
|
|
|
*/
|
|
|
|
|
2016-10-12 19:50:49 +00:00
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
|
2015-10-28 02:53:27 +00:00
|
|
|
/** required, it is the file under test */
|
|
|
|
require_once('include/attach.php');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* TestCase for the uploader
|
2016-10-12 19:50:49 +00:00
|
|
|
*
|
2015-10-28 02:53:27 +00:00
|
|
|
* @author ken restivo
|
|
|
|
* @package test.util
|
|
|
|
*/
|
2016-10-12 19:50:49 +00:00
|
|
|
class UploadTest extends TestCase {
|
2015-10-28 02:53:27 +00:00
|
|
|
public function testFileNameMutipleDots() {
|
|
|
|
$multidots = "foo.bar.baz.0.1.3.ogg";
|
|
|
|
$this->assertEquals("audio/ogg", z_mime_content_type($multidots));
|
|
|
|
$this->assertNotEquals("application/octet-stream", z_mime_content_type($multidots));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testFileNameOneDot() {
|
|
|
|
$multidots = "foo.ogg";
|
|
|
|
$this->assertEquals("audio/ogg", z_mime_content_type($multidots));
|
|
|
|
$this->assertNotEquals("application/octet-stream", z_mime_content_type($multidots));
|
|
|
|
}
|
|
|
|
}
|