mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-29 13:03:52 +03:00
Fix test when CLI output viewport is too narrow
This commit is contained in:
parent
556520583a
commit
ef075fb0ce
2 changed files with 6 additions and 5 deletions
|
@ -69,7 +69,7 @@ class CreateShortUrlCommandTest extends TestCase
|
||||||
|
|
||||||
self::assertEquals(ExitCodes::EXIT_SUCCESS, $this->commandTester->getStatusCode());
|
self::assertEquals(ExitCodes::EXIT_SUCCESS, $this->commandTester->getStatusCode());
|
||||||
self::assertStringContainsString('stringified_short_url', $output);
|
self::assertStringContainsString('stringified_short_url', $output);
|
||||||
self::assertStringNotContainsString('but the real-time updates cannot be notified', $output);
|
self::assertStringNotContainsString('but the real-time updates cannot', $output);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Test]
|
#[Test]
|
||||||
|
@ -195,11 +195,11 @@ class CreateShortUrlCommandTest extends TestCase
|
||||||
public static function provideDispatchBehavior(): iterable
|
public static function provideDispatchBehavior(): iterable
|
||||||
{
|
{
|
||||||
$containsAssertion = static fn (string $output) => self::assertStringContainsString(
|
$containsAssertion = static fn (string $output) => self::assertStringContainsString(
|
||||||
'but the real-time updates cannot be notified',
|
'but the real-time updates cannot',
|
||||||
$output,
|
$output,
|
||||||
);
|
);
|
||||||
$doesNotContainAssertion = static fn (string $output) => self::assertStringNotContainsString(
|
$doesNotContainAssertion = static fn (string $output) => self::assertStringNotContainsString(
|
||||||
'but the real-time updates cannot be notified',
|
'but the real-time updates cannot',
|
||||||
$output,
|
$output,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ class UrlShortenerTest extends TestCase
|
||||||
|
|
||||||
$result = $this->urlShortener->shorten($meta);
|
$result = $this->urlShortener->shorten($meta);
|
||||||
$thereIsError = false;
|
$thereIsError = false;
|
||||||
$result->onEventDispatchingError(function () use (&$thereIsError) {
|
$result->onEventDispatchingError(function () use (&$thereIsError): void {
|
||||||
$thereIsError = true;
|
$thereIsError = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -75,7 +75,8 @@ class UrlShortenerTest extends TestCase
|
||||||
|
|
||||||
public static function provideDispatchBehavior(): iterable
|
public static function provideDispatchBehavior(): iterable
|
||||||
{
|
{
|
||||||
yield 'no dispatch error' => [false, static function (): void {}];
|
yield 'no dispatch error' => [false, static function (): void {
|
||||||
|
}];
|
||||||
yield 'dispatch error' => [true, static function (): void {
|
yield 'dispatch error' => [true, static function (): void {
|
||||||
throw new ServiceNotFoundException();
|
throw new ServiceNotFoundException();
|
||||||
}];
|
}];
|
||||||
|
|
Loading…
Add table
Reference in a new issue