public function testReturnsFirstPostedFileFromCollection()
 {
     $mock = $this->getMock('Barberry\\PostedDataProcessor', array('createCollection'));
     $mock->expects($this->once())->method('createCollection')->with(array('files'))->will($this->returnValue(new \Barberry\PostedFile\Collection(array('file' => new PostedFile('some', 'Name of a file.txt')), array('image' => new PostedFile(Test\Data::gif1x1(), 'test.gif')))));
     $this->assertEquals('Name of a file.txt', $mock->process(array('files'))->filename);
 }
Beispiel #2
0
 public function testReturnStandardExtension()
 {
     $postedFile = new PostedFile(Test\Data::gif1x1(), 'some filename');
     $this->assertEquals('gif', $postedFile->getStandardExtension());
 }