コード例 #1
0
 public function testNonRecursiveSerializationWithFile()
 {
     $request = new MultipartRequest();
     $multipartRequest = new MultipartFormData();
     $file = new File();
     $file->setPath(__FILE__);
     $request->data = array('test1' => 1, 'file' => $file);
     $serilizedData = $multipartRequest->visit($request, new Serializer());
     $this->assertNotEmpty($serilizedData, "serializer returned nothing");
     $this->assertArrayHasKey('test1', $serilizedData, "test1 field is non existent");
     $this->assertArrayHasKey('file', $serilizedData, "test1 field is non existent");
     $this->assertEquals(1, $serilizedData['test1']);
     $this->assertEquals("FILE::" . __FILE__, $serilizedData['file']);
 }
コード例 #2
0
 private function getPDF()
 {
     $path = realpath(dirname(__FILE__));
     $pdf = $path . "/UpdateTransactionTest.pdf";
     $file = new File();
     $file->setPath($pdf);
     return $file;
 }
コード例 #3
0
 private function getFile()
 {
     $file = new File();
     $file->setPath(__FILE__);
     return $file;
 }