Skip to content
This repository was archived by the owner on Jan 29, 2024. It is now read-only.

Commit f6ec943

Browse files
author
Pavel Batanov
authored
Allow static assert calls
1 parent d960f43 commit f6ec943

1 file changed

Lines changed: 25 additions & 25 deletions

File tree

Test/WebTestCase.php

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,31 @@ abstract class WebTestCase extends BaseWebTestCase
7676
*/
7777
private static $cachedMetadatas = [];
7878

79+
/**
80+
* Asserts that the HTTP response code of the last request performed by
81+
* $client matches the expected code. If not, raises an error with more
82+
* information.
83+
*
84+
* @param $expectedStatusCode
85+
* @param Client $client
86+
*/
87+
public static function assertStatusCode($expectedStatusCode, Client $client)
88+
{
89+
HttpAssertions::assertStatusCode($expectedStatusCode, $client);
90+
}
91+
92+
/**
93+
* Assert that the last validation errors within $container match the
94+
* expected keys.
95+
*
96+
* @param array $expected A flat array of field names
97+
* @param ContainerInterface $container
98+
*/
99+
public static function assertValidationErrors(array $expected, ContainerInterface $container)
100+
{
101+
HttpAssertions::assertValidationErrors($expected, $container);
102+
}
103+
79104
protected static function getKernelClass()
80105
{
81106
$dir = isset($_SERVER['KERNEL_DIR']) ? $_SERVER['KERNEL_DIR'] : static::getPhpUnitXmlDir();
@@ -918,31 +943,6 @@ public function loginAs(UserInterface $user, $firewallName)
918943
return $this;
919944
}
920945

921-
/**
922-
* Asserts that the HTTP response code of the last request performed by
923-
* $client matches the expected code. If not, raises an error with more
924-
* information.
925-
*
926-
* @param $expectedStatusCode
927-
* @param Client $client
928-
*/
929-
public function assertStatusCode($expectedStatusCode, Client $client)
930-
{
931-
HttpAssertions::assertStatusCode($expectedStatusCode, $client);
932-
}
933-
934-
/**
935-
* Assert that the last validation errors within $container match the
936-
* expected keys.
937-
*
938-
* @param array $expected A flat array of field names
939-
* @param ContainerInterface $container
940-
*/
941-
public function assertValidationErrors(array $expected, ContainerInterface $container)
942-
{
943-
HttpAssertions::assertValidationErrors($expected, $container);
944-
}
945-
946946
/**
947947
* @param array $excludedDoctrineTables
948948
*/

0 commit comments

Comments
 (0)