Check which WebTestCase
class you are using. Most probably you are using
use Symfony\Bundle\FrameworkBundle\Tests\Functional\WebTestCase
and you should be using
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
So just change this one line and you should be good