예제 #1
0
 public function testImage()
 {
     Former::withRules(array('foo' => 'image'));
     $input = Former::file('foo')->__toString();
     $matcher = $this->cg($this->field(array('accept' => 'image/jpeg,image/png,image/gif,image/bmp'), 'file'));
     $this->assertEquals($matcher, $input);
 }
예제 #2
0
 public function testMaxSizeOctets()
 {
     $file = Former::file('foo')->max(2, 'Mo')->__toString();
     $matcher = $this->cg('<input type="file" name="foo" id="foo"><input type="hidden" name="MAX_FILE_SIZE" value="2097152">');
     $this->assertEquals($matcher, $file);
 }