mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 19:48:49 +02:00
N°8834 - Add compatibility with PHP 8.4 (#819)
* N°8834 - Add compatibility with PHP 8.4 * Rollback of scssphp/scssphp version upgrade due to compilation error
This commit is contained in:
@@ -14,13 +14,12 @@ namespace Symfony\Bundle\FrameworkBundle\Test;
|
||||
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
|
||||
use Symfony\Component\HttpClient\DataCollector\HttpClientDataCollector;
|
||||
|
||||
/*
|
||||
/**
|
||||
* @author Mathieu Santostefano <msantostefano@protonmail.com>
|
||||
*/
|
||||
|
||||
trait HttpClientAssertionsTrait
|
||||
{
|
||||
public static function assertHttpClientRequest(string $expectedUrl, string $expectedMethod = 'GET', string|array $expectedBody = null, array $expectedHeaders = [], string $httpClientId = 'http_client'): void
|
||||
public static function assertHttpClientRequest(string $expectedUrl, string $expectedMethod = 'GET', string|array|null $expectedBody = null, array $expectedHeaders = [], string $httpClientId = 'http_client'): void
|
||||
{
|
||||
/** @var KernelBrowser $client */
|
||||
$client = static::getClient();
|
||||
@@ -34,7 +33,7 @@ trait HttpClientAssertionsTrait
|
||||
$expectedRequestHasBeenFound = false;
|
||||
|
||||
if (!\array_key_exists($httpClientId, $httpClientDataCollector->getClients())) {
|
||||
static::fail(sprintf('HttpClient "%s" is not registered.', $httpClientId));
|
||||
static::fail(\sprintf('HttpClient "%s" is not registered.', $httpClientId));
|
||||
}
|
||||
|
||||
foreach ($httpClientDataCollector->getClients()[$httpClientId]['traces'] as $trace) {
|
||||
@@ -102,7 +101,7 @@ trait HttpClientAssertionsTrait
|
||||
$unexpectedUrlHasBeenFound = false;
|
||||
|
||||
if (!\array_key_exists($httpClientId, $httpClientDataCollector->getClients())) {
|
||||
static::fail(sprintf('HttpClient "%s" is not registered.', $httpClientId));
|
||||
static::fail(\sprintf('HttpClient "%s" is not registered.', $httpClientId));
|
||||
}
|
||||
|
||||
foreach ($httpClientDataCollector->getClients()[$httpClientId]['traces'] as $trace) {
|
||||
@@ -114,7 +113,7 @@ trait HttpClientAssertionsTrait
|
||||
}
|
||||
}
|
||||
|
||||
self::assertFalse($unexpectedUrlHasBeenFound, sprintf('Unexpected URL called: "%s" - "%s"', $expectedMethod, $unexpectedUrl));
|
||||
self::assertFalse($unexpectedUrlHasBeenFound, \sprintf('Unexpected URL called: "%s" - "%s"', $expectedMethod, $unexpectedUrl));
|
||||
}
|
||||
|
||||
public static function assertHttpClientRequestCount(int $count, string $httpClientId = 'http_client'): void
|
||||
|
||||
Reference in New Issue
Block a user