Example #1
0
 public function testDetectPath()
 {
     $this->assertEquals('text/plain', $this->detection->detectPath('foo.txt'));
     $this->assertEquals('image/png', $this->detection->detectPath('foo.png'));
     $this->assertEquals('image/png', $this->detection->detectPath('foo.bar.png'));
     $this->assertEquals('application/octet-stream', $this->detection->detectPath('.png'));
     $this->assertEquals('application/octet-stream', $this->detection->detectPath('foo'));
     $this->assertEquals('application/octet-stream', $this->detection->detectPath(''));
 }
Example #2
0
 public function testDetectPath()
 {
     $detection = new Detection(\OC::$server->getURLGenerator(), \OC::$configDir);
     $this->assertEquals('text/plain', $detection->detectPath('foo.txt'));
     $this->assertEquals('image/png', $detection->detectPath('foo.png'));
     $this->assertEquals('image/png', $detection->detectPath('foo.bar.png'));
     $this->assertEquals('application/octet-stream', $detection->detectPath('.png'));
     $this->assertEquals('application/octet-stream', $detection->detectPath('foo'));
     $this->assertEquals('application/octet-stream', $detection->detectPath(''));
 }