The auto-generate CRUD tool generated the CustomerControllerTest.php
file for us within the src/Foggyline/CustomerBundle/Tests/Controller/
directory. In the previous chapter we showed how to pass an authentication parameter to static::createClient
in order to make it simulate user logging. However, that is not the same login as our customers will be using. We are no longer using a basic HTTP authentication, rather a full blown login form.
In order to address the login form testing, let's go ahead and edit the src/Foggyline/CustomerBundle/Tests/Controller/CustomerControllerTest.php
file as follows:
namespace Foggyline\CustomerBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\BrowserKit\Cookie; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; class CustomerControllerTest extends WebTestCase { private $client = null; public function setUp() { $this->client = static::createClient...