예제 #1
0
 public function testIsType()
 {
     $m = new ae_MediaModel();
     $m->setType('image/png');
     $this->assertTrue($m->isImage());
     $this->assertFalse($m->isText());
     $this->assertFalse($m->isVideo());
     $m->setType('text/plain');
     $this->assertFalse($m->isImage());
     $this->assertTrue($m->isText());
     $this->assertFalse($m->isVideo());
     $m->setType('video/ogg');
     $this->assertFalse($m->isImage());
     $this->assertFalse($m->isText());
     $this->assertTrue($m->isVideo());
     $m->setType('unknown');
     $this->assertFalse($m->isImage());
     $this->assertFalse($m->isText());
     $this->assertFalse($m->isVideo());
     $m->setType(FALSE);
     $this->assertFalse($m->isImage());
     $this->assertFalse($m->isText());
     $this->assertFalse($m->isVideo());
     $m->setType(TRUE);
     $this->assertFalse($m->isImage());
     $this->assertFalse($m->isText());
     $this->assertFalse($m->isVideo());
     $m->setType(NULL);
     $this->assertFalse($m->isImage());
     $this->assertFalse($m->isText());
     $this->assertFalse($m->isVideo());
 }