Пример #1
0
 /**
  * @ignore
  * @param \BLW\Type\HTTP\IRequest $Request
  * @param array $Fields
  */
 private function _addMultipartFields(IRequest $Request, array $Fields)
 {
     // Section
     $Section = new Section('multipart/form-data');
     // Set Content-Type Header
     $Request->Header['Content-Type'] = $Section->createStart();
     // Add fields
     foreach ($Fields as $Field) {
         $Request->Body[] = $Section->createBoundary();
         $Request->Body[] = $Field;
     }
     // End section
     $Request->Body[] = $Section->createEnd();
 }
Пример #2
0
 /**
  * @depends test_construct
  * @covers ::createEnd
  */
 public function test_createEnd()
 {
     $Expected = "--0-00000:=00000--\r\n";
     $this->assertInstanceOf('\\BLW\\Model\\MIME\\Boundary', $this->Section->createEnd(), 'Section::createStart() returned an invalid value');
     $this->assertEquals($Expected, strval($this->Section->createEnd()), 'Section::createStart() returned an invalid value');
 }