예제 #1
0
 /**
  * Test's http part delete functionality
  */
 public function testHttpPartDeleteMethod()
 {
     $part = $this->part->getInstance();
     $partFilename = md5(time());
     $part->setFilename($partFilename);
     $part->setName('testPartName');
     $part->addHeader('Content-Type', 'text/plain');
     $part->putContent('testContent0000000');
     $part->delete();
     $this->assertSame(is_resource($part->getInputStream()), false);
 }
예제 #2
0
 /**
  * adds a part to the parts collection
  *
  * @param \TechDivision\Http\HttpPart $part A form part object
  * @param string                      $name A manually defined name
  *
  * @return void
  */
 public function addPart(HttpPart $part, $name = null)
 {
     if (is_null($name)) {
         $name = $part->getName();
     }
     $this->parts[$name] = $part;
 }