Jarves\Tests\KernelAwareTestCase::createClient PHP Method

createClient() protected static method

Creates a Client.
protected static createClient ( array $options = [], array $server = [] ) : Client
$options array An array of options to pass to the createKernel class
$server array An array of server parameters
return Symfony\Bundle\FrameworkBundle\Client A Client instance
    protected static function createClient(array $options = array(), array $server = array())
    {
        if (!static::$kernel || !static::$kernel->getContainer()->has('test.client')) {
            static::bootKernel($options);
        }
        $client = static::$kernel->getContainer()->get('test.client');
        $client->setServerParameters($server);
        return $client;
    }