priority -40

snippet sftestcase "Symfony / Tests / WebTestCase" b
<?php`!v sniphpets#header()`

namespace `!v sniphpets#namespace()`;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

class `!v sniphpets#basename()` extends WebTestCase
{
	${VISUAL}${0}
}
endsnippet

snippet sftest "Symfony / Tests / WebTestCase method" b
public function test${1}()
{
	$client = static::createClient();

	$crawler = $client->request('${2:GET}', '${3}');

	${VISUAL}${0}
}
endsnippet

snippet sftestsmoke "Symfony / Tests / Smoke test methods" b
/**
 * @dataProvider urlProvider
 */
public function testPageIsSuccessful(string $url)
{
	$client = self::createClient();
	$client->request('GET', $url);

	$response = $client->getResponse();

	$this->assertTrue(
		$response->isSuccessful(),
		sprintf('Page "%s" doesn\'t work. Status: %d.', $url, $response->getStatusCode())
	);
}

public function urlProvider()
{
	yield ['/${1}'];${0}
}
endsnippet
