Skip to content

Commit

Permalink
Allow static assert calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Batanov authored Aug 7, 2018
1 parent d960f43 commit f6ec943
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 f6ec943

Please sign in to comment.