public function testToStringWithParameterAndBody() { $request = new Request(); $request->setMethod('POST'); $request->setUrl(new Url('http://www.versionable.co.uk')); $request->getParameters()->add(new Parameter('name', 'prospect')); $request->getFiles()->add(new File('file1', __DIR__ . '/../../../../data/file/file1.txt', 'text/plain')); $request->getFiles()->add(new File('file2', __DIR__ . '/../../../../data/file/file2.txt', 'text/plain')); $this->object->setRequest($request); $actual = $this->object->toString(); $expected = str_replace('!boundary!', str_replace('-', '', $this->object->getBoundary()), file_get_contents(__DIR__ . '/../../../../data/request/request-with-parameters-files.txt')); $this->assertEquals($expected, $actual); }
/** * @todo Implement testGetFiles(). */ public function testGetFiles() { $files = $this->getMock('Versionable\\Prospect\\File\\CollectionInterface'); $this->object->setFiles($files); $this->assertEquals($this->object->getFiles(), $this->readAttribute($this->object, 'files')); }