Symfony\Bundle\FrameworkBundle\Tests\Controller\TestController::file PHP Method

file() public method

public file ( $file, $fileName = null, $disposition = ResponseHeaderBag::DISPOSITION_ATTACHMENT )
    public function file($file, $fileName = null, $disposition = ResponseHeaderBag::DISPOSITION_ATTACHMENT)
    {
        return parent::file($file, $fileName, $disposition);
    }

Usage Example

Example #1
0
 /**
  * @expectedException \Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException
  */
 public function testFileWhichDoesNotExist()
 {
     $controller = new TestController();
     /* @var BinaryFileResponse $response */
     $response = $controller->file('some-file.txt', 'test.php');
 }