Skip to content
This repository has been archived by the owner on May 5, 2024. It is now read-only.

Commit

Permalink
Fixing the tests for PHP 5.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonsavage committed Jun 30, 2015
1 parent 6dd8917 commit bbc130d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tests/FileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ class FileTest extends PHPUnit_Framework_TestCase
public function setUp()
{
// Set FileInfo factory
\Upload\FileInfo::setFactory(function ($tmpName, $name) {
$fileInfo = $this->getMock(
$phpunit = $this;
\Upload\FileInfo::setFactory(function ($tmpName, $name) use ($phpunit) {
$fileInfo = $phpunit->getMock(
'\Upload\FileInfo',
array('isUploadedFile'),
array($tmpName, $name)
);
$fileInfo
->expects($this->any())
->expects($phpunit->any())
->method('isUploadedFile')
->will($this->returnValue(true));
->will($phpunit->returnValue(true));

return $fileInfo;
});
Expand Down Expand Up @@ -181,16 +182,17 @@ public function testIsInvalidIfHttpErrorCode()

public function testIsInvalidIfNotUploadedFile()
{
\Upload\FileInfo::setFactory(function ($tmpName, $name) {
$fileInfo = $this->getMock(
$phpunit = $this;
\Upload\FileInfo::setFactory(function ($tmpName, $name) use ($phpunit) {
$fileInfo = $phpunit->getMock(
'\Upload\FileInfo',
array('isUploadedFile'),
array($tmpName, $name)
);
$fileInfo
->expects($this->any())
->expects($phpunit->any())
->method('isUploadedFile')
->will($this->returnValue(false));
->will($phpunit->returnValue(false));

return $fileInfo;
});
Expand Down

0 comments on commit bbc130d

Please sign in to comment.