mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
Re-dump autoloader and composer.lock
This commit is contained in:
@@ -171,7 +171,7 @@ trait BrowserKitAssertionsTrait
|
||||
}
|
||||
|
||||
if (!$client instanceof AbstractBrowser) {
|
||||
static::fail(sprintf('A client must be set to make assertions on it. Did you forget to call "%s::createClient()"?', __CLASS__));
|
||||
static::fail(\sprintf('A client must be set to make assertions on it. Did you forget to call "%s::createClient()"?', __CLASS__));
|
||||
}
|
||||
|
||||
return $client;
|
||||
|
||||
@@ -26,12 +26,12 @@ trait DomCrawlerAssertionsTrait
|
||||
{
|
||||
public static function assertSelectorExists(string $selector, string $message = ''): void
|
||||
{
|
||||
self::assertThat(self::getCrawler(), new DomCrawlerConstraint\CrawlerSelectorExists($selector), $message);
|
||||
self::assertThat(self::getCrawler(), new CrawlerSelectorExists($selector), $message);
|
||||
}
|
||||
|
||||
public static function assertSelectorNotExists(string $selector, string $message = ''): void
|
||||
{
|
||||
self::assertThat(self::getCrawler(), new LogicalNot(new DomCrawlerConstraint\CrawlerSelectorExists($selector)), $message);
|
||||
self::assertThat(self::getCrawler(), new LogicalNot(new CrawlerSelectorExists($selector)), $message);
|
||||
}
|
||||
|
||||
public static function assertSelectorCount(int $expectedCount, string $selector, string $message = ''): void
|
||||
@@ -42,7 +42,7 @@ trait DomCrawlerAssertionsTrait
|
||||
public static function assertSelectorTextContains(string $selector, string $text, string $message = ''): void
|
||||
{
|
||||
self::assertThat(self::getCrawler(), LogicalAnd::fromConstraints(
|
||||
new DomCrawlerConstraint\CrawlerSelectorExists($selector),
|
||||
new CrawlerSelectorExists($selector),
|
||||
new DomCrawlerConstraint\CrawlerSelectorTextContains($selector, $text)
|
||||
), $message);
|
||||
}
|
||||
@@ -50,7 +50,7 @@ trait DomCrawlerAssertionsTrait
|
||||
public static function assertAnySelectorTextContains(string $selector, string $text, string $message = ''): void
|
||||
{
|
||||
self::assertThat(self::getCrawler(), LogicalAnd::fromConstraints(
|
||||
new DomCrawlerConstraint\CrawlerSelectorExists($selector),
|
||||
new CrawlerSelectorExists($selector),
|
||||
new DomCrawlerConstraint\CrawlerAnySelectorTextContains($selector, $text)
|
||||
), $message);
|
||||
}
|
||||
@@ -58,7 +58,7 @@ trait DomCrawlerAssertionsTrait
|
||||
public static function assertSelectorTextSame(string $selector, string $text, string $message = ''): void
|
||||
{
|
||||
self::assertThat(self::getCrawler(), LogicalAnd::fromConstraints(
|
||||
new DomCrawlerConstraint\CrawlerSelectorExists($selector),
|
||||
new CrawlerSelectorExists($selector),
|
||||
new DomCrawlerConstraint\CrawlerSelectorTextSame($selector, $text)
|
||||
), $message);
|
||||
}
|
||||
@@ -66,7 +66,7 @@ trait DomCrawlerAssertionsTrait
|
||||
public static function assertAnySelectorTextSame(string $selector, string $text, string $message = ''): void
|
||||
{
|
||||
self::assertThat(self::getCrawler(), LogicalAnd::fromConstraints(
|
||||
new DomCrawlerConstraint\CrawlerSelectorExists($selector),
|
||||
new CrawlerSelectorExists($selector),
|
||||
new DomCrawlerConstraint\CrawlerAnySelectorTextSame($selector, $text)
|
||||
), $message);
|
||||
}
|
||||
@@ -74,7 +74,7 @@ trait DomCrawlerAssertionsTrait
|
||||
public static function assertSelectorTextNotContains(string $selector, string $text, string $message = ''): void
|
||||
{
|
||||
self::assertThat(self::getCrawler(), LogicalAnd::fromConstraints(
|
||||
new DomCrawlerConstraint\CrawlerSelectorExists($selector),
|
||||
new CrawlerSelectorExists($selector),
|
||||
new LogicalNot(new DomCrawlerConstraint\CrawlerSelectorTextContains($selector, $text))
|
||||
), $message);
|
||||
}
|
||||
@@ -82,7 +82,7 @@ trait DomCrawlerAssertionsTrait
|
||||
public static function assertAnySelectorTextNotContains(string $selector, string $text, string $message = ''): void
|
||||
{
|
||||
self::assertThat(self::getCrawler(), LogicalAnd::fromConstraints(
|
||||
new DomCrawlerConstraint\CrawlerSelectorExists($selector),
|
||||
new CrawlerSelectorExists($selector),
|
||||
new LogicalNot(new DomCrawlerConstraint\CrawlerAnySelectorTextContains($selector, $text))
|
||||
), $message);
|
||||
}
|
||||
@@ -100,7 +100,7 @@ trait DomCrawlerAssertionsTrait
|
||||
public static function assertInputValueSame(string $fieldName, string $expectedValue, string $message = ''): void
|
||||
{
|
||||
self::assertThat(self::getCrawler(), LogicalAnd::fromConstraints(
|
||||
new DomCrawlerConstraint\CrawlerSelectorExists("input[name=\"$fieldName\"]"),
|
||||
new CrawlerSelectorExists("input[name=\"$fieldName\"]"),
|
||||
new DomCrawlerConstraint\CrawlerSelectorAttributeValueSame("input[name=\"$fieldName\"]", 'value', $expectedValue)
|
||||
), $message);
|
||||
}
|
||||
@@ -108,7 +108,7 @@ trait DomCrawlerAssertionsTrait
|
||||
public static function assertInputValueNotSame(string $fieldName, string $expectedValue, string $message = ''): void
|
||||
{
|
||||
self::assertThat(self::getCrawler(), LogicalAnd::fromConstraints(
|
||||
new DomCrawlerConstraint\CrawlerSelectorExists("input[name=\"$fieldName\"]"),
|
||||
new CrawlerSelectorExists("input[name=\"$fieldName\"]"),
|
||||
new LogicalNot(new DomCrawlerConstraint\CrawlerSelectorAttributeValueSame("input[name=\"$fieldName\"]", 'value', $expectedValue))
|
||||
), $message);
|
||||
}
|
||||
@@ -126,18 +126,18 @@ trait DomCrawlerAssertionsTrait
|
||||
public static function assertFormValue(string $formSelector, string $fieldName, string $value, string $message = ''): void
|
||||
{
|
||||
$node = self::getCrawler()->filter($formSelector);
|
||||
self::assertNotEmpty($node, sprintf('Form "%s" not found.', $formSelector));
|
||||
self::assertNotEmpty($node, \sprintf('Form "%s" not found.', $formSelector));
|
||||
$values = $node->form()->getValues();
|
||||
self::assertArrayHasKey($fieldName, $values, $message ?: sprintf('Field "%s" not found in form "%s".', $fieldName, $formSelector));
|
||||
self::assertArrayHasKey($fieldName, $values, $message ?: \sprintf('Field "%s" not found in form "%s".', $fieldName, $formSelector));
|
||||
self::assertSame($value, $values[$fieldName]);
|
||||
}
|
||||
|
||||
public static function assertNoFormValue(string $formSelector, string $fieldName, string $message = ''): void
|
||||
{
|
||||
$node = self::getCrawler()->filter($formSelector);
|
||||
self::assertNotEmpty($node, sprintf('Form "%s" not found.', $formSelector));
|
||||
self::assertNotEmpty($node, \sprintf('Form "%s" not found.', $formSelector));
|
||||
$values = $node->form()->getValues();
|
||||
self::assertArrayNotHasKey($fieldName, $values, $message ?: sprintf('Field "%s" has a value in form "%s".', $fieldName, $formSelector));
|
||||
self::assertArrayNotHasKey($fieldName, $values, $message ?: \sprintf('Field "%s" has a value in form "%s".', $fieldName, $formSelector));
|
||||
}
|
||||
|
||||
private static function getCrawler(): Crawler
|
||||
|
||||
@@ -33,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) {
|
||||
@@ -101,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) {
|
||||
@@ -113,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
|
||||
|
||||
@@ -60,11 +60,11 @@ abstract class KernelTestCase extends TestCase
|
||||
protected static function getKernelClass(): string
|
||||
{
|
||||
if (!isset($_SERVER['KERNEL_CLASS']) && !isset($_ENV['KERNEL_CLASS'])) {
|
||||
throw new \LogicException(sprintf('You must set the KERNEL_CLASS environment variable to the fully-qualified class name of your Kernel in phpunit.xml / phpunit.xml.dist or override the "%1$s::createKernel()" or "%1$s::getKernelClass()" method.', static::class));
|
||||
throw new \LogicException(\sprintf('You must set the KERNEL_CLASS environment variable to the fully-qualified class name of your Kernel in phpunit.xml / phpunit.xml.dist or override the "%1$s::createKernel()" or "%1$s::getKernelClass()" method.', static::class));
|
||||
}
|
||||
|
||||
if (!class_exists($class = $_ENV['KERNEL_CLASS'] ?? $_SERVER['KERNEL_CLASS'])) {
|
||||
throw new \RuntimeException(sprintf('Class "%s" doesn\'t exist or cannot be autoloaded. Check that the KERNEL_CLASS value in phpunit.xml matches the fully-qualified class name of your Kernel or override the "%s::createKernel()" method.', $class, static::class));
|
||||
throw new \RuntimeException(\sprintf('Class "%s" doesn\'t exist or cannot be autoloaded. Check that the KERNEL_CLASS value in phpunit.xml matches the fully-qualified class name of your Kernel or override the "%s::createKernel()" method.', $class, static::class));
|
||||
}
|
||||
|
||||
return $class;
|
||||
|
||||
@@ -78,7 +78,7 @@ class TestContainer extends Container
|
||||
throw $e;
|
||||
}
|
||||
if (isset($container->privates[$renamedId])) {
|
||||
throw new InvalidArgumentException(sprintf('The "%s" service is already initialized, you cannot replace it.', $id));
|
||||
throw new InvalidArgumentException(\sprintf('The "%s" service is already initialized, you cannot replace it.', $id));
|
||||
}
|
||||
$container->privates[$renamedId] = $service;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ abstract class WebTestCase extends KernelTestCase
|
||||
protected static function createClient(array $options = [], array $server = []): KernelBrowser
|
||||
{
|
||||
if (static::$booted) {
|
||||
throw new \LogicException(sprintf('Booting the kernel before calling "%s()" is not supported, the kernel should only be booted once.', __METHOD__));
|
||||
throw new \LogicException(\sprintf('Booting the kernel before calling "%s()" is not supported, the kernel should only be booted once.', __METHOD__));
|
||||
}
|
||||
|
||||
$kernel = static::bootKernel($options);
|
||||
|
||||
Reference in New Issue
Block a user