Skip to content

Instantly share code, notes, and snippets.

@johnwards
Created August 2, 2011 15:36
Show Gist options
  • Save johnwards/1120453 to your computer and use it in GitHub Desktop.
Save johnwards/1120453 to your computer and use it in GitHub Desktop.
Send yourself to a non existant route. The file should be in the file bag...it's missing :(
<?php
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class UploadTest extends WebTestCase
{
public function testNewPhotos()
{
$client = $this->createClient();
$client->request('POST', '/submit', array('name' => 'Fabien'), array('photo' => __FILE__));
$this->assertEquals(1, count($client->getRequest()->files->all()));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment