Пример #1
0
 /**
  * Test that ext() returns true if the file extension is within the whitelist.
  */
 public function testExt()
 {
     $this->assertTrue(Validate::ext('image.gif'));
     $this->assertTrue(Validate::ext('image.jpeg'));
     $this->assertTrue(Validate::ext('doc.pdf', 'pdf'));
     $this->assertTrue(Validate::ext('web.HTML', array('html', 'xhtml')));
     $this->assertFalse(Validate::ext('image.bmp'));
     $this->assertFalse(Validate::ext('doc.doc', 'pdf'));
     $this->assertFalse(Validate::ext('web.XML', array('html', 'xhtml')));
 }