Beispiel #1
0
 function testCanRemoveFilterWithSingleFilterSet()
 {
     $input = new T_Form_Upload('myalias', 'mylabel');
     $files = array($input->getFieldname() => new T_File_Uploaded('first/path', 150, 'first.txt'));
     $src = new T_Test_Cage_PostStub(array(), $files);
     $filter = new T_Test_Filter_Failure();
     $input->attachFilter($filter)->removeFilter($filter)->validate($src);
     $this->assertTrue($input->isValid());
 }
Beispiel #2
0
 /**
  * Visit a file upload input node.
  *
  * @param T_Form_Upload $node
  */
 function visitFormUpload(T_Form_Upload $node)
 {
     $attributes = $node->getAllAttributes();
     $attributes += array('type' => 'file', 'name' => $node->getFieldname(), 'id' => $this->getNodeId($node));
     $xhtml = $this->createLabel($node) . $this->createInput($node, $attributes);
     $this->addXhtml($xhtml);
 }