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']); }
private function getPDF() { $path = realpath(dirname(__FILE__)); $pdf = $path . "/UpdateTransactionTest.pdf"; $file = new File(); $file->setPath($pdf); return $file; }
private function getFile() { $file = new File(); $file->setPath(__FILE__); return $file; }