I have a symfony site and am trying to run some unit tests. I have a test where I'm trying to imagine something:
<?php namespace Acme\AcmeBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class HomeControllerTest extends WebTestCase { public function testrandomeThings() { $client = static::createClient(); $crawler = $client->request( 'POST', '/', array( "shopNumber" => 0099, "cardNumber" => 231, "cardPIN" => "adasd"), array(), array()); }
but I donβt think Im sending data to the controller:
class HomeController extends Controller { public function indexAction() { var_dump($_POST); die; return $this->render('AcmeBundle:Home:index.html.twig'); } }
the var_dump actually returns me an empty array.
What am I missing to send information through my POST request?
post php tdd symfony phpunit
Enrique Moreno Tent
source share