Skip to content

Commit

Permalink
Merge pull request #445 from scaytrase/patch-1
Browse files Browse the repository at this point in the history
Allow static assertion calls
  • Loading branch information
alexislefebvre authored Aug 10, 2018
2 parents 81fd101 + f6ec943 commit cbfa26d
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions Test/WebTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,31 @@ abstract class WebTestCase extends BaseWebTestCase
*/
private static $cachedMetadatas = [];

/**
* Asserts that the HTTP response code of the last request performed by
* $client matches the expected code. If not, raises an error with more
* information.
*
* @param $expectedStatusCode
* @param Client $client
*/
public static function assertStatusCode($expectedStatusCode, Client $client)
{
HttpAssertions::assertStatusCode($expectedStatusCode, $client);
}

/**
* Assert that the last validation errors within $container match the
* expected keys.
*
* @param array $expected A flat array of field names
* @param ContainerInterface $container
*/
public static function assertValidationErrors(array $expected, ContainerInterface $container)
{
HttpAssertions::assertValidationErrors($expected, $container);
}

protected static function getKernelClass()
{
$dir = isset($_SERVER['KERNEL_DIR']) ? $_SERVER['KERNEL_DIR'] : static::getPhpUnitXmlDir();
Expand Down Expand Up @@ -918,31 +943,6 @@ public function loginAs(UserInterface $user, $firewallName)
return $this;
}

/**
* Asserts that the HTTP response code of the last request performed by
* $client matches the expected code. If not, raises an error with more
* information.
*
* @param $expectedStatusCode
* @param Client $client
*/
public function assertStatusCode($expectedStatusCode, Client $client)
{
HttpAssertions::assertStatusCode($expectedStatusCode, $client);
}

/**
* Assert that the last validation errors within $container match the
* expected keys.
*
* @param array $expected A flat array of field names
* @param ContainerInterface $container
*/
public function assertValidationErrors(array $expected, ContainerInterface $container)
{
HttpAssertions::assertValidationErrors($expected, $container);
}

/**
* @param array $excludedDoctrineTables
*/
Expand Down

0 comments on commit cbfa26d

Please sign in to comment.