mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Created NotConfiguredMercureErrorHandlerTest
This commit is contained in:
@@ -11,7 +11,6 @@ use PHPUnit\Framework\TestCase;
|
||||
use Prophecy\Argument;
|
||||
use Prophecy\PhpUnit\ProphecyTrait;
|
||||
use Prophecy\Prophecy\ObjectProphecy;
|
||||
use RuntimeException;
|
||||
use Shlinkio\Shlink\Common\Mercure\JwtProviderInterface;
|
||||
use Shlinkio\Shlink\Rest\Action\MercureInfoAction;
|
||||
use Shlinkio\Shlink\Rest\Exception\MercureException;
|
||||
@@ -49,24 +48,6 @@ class MercureInfoActionTest extends TestCase
|
||||
yield 'host is null' => [['public_hub_url' => null]];
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @dataProvider provideValidConfigs
|
||||
*/
|
||||
public function throwsExceptionWhenBuildingTokenFails(array $mercureConfig): void
|
||||
{
|
||||
$buildToken = $this->provider->buildSubscriptionToken(Argument::any())->willThrow(
|
||||
new RuntimeException('Error'),
|
||||
);
|
||||
|
||||
$action = new MercureInfoAction($this->provider->reveal(), $mercureConfig);
|
||||
|
||||
$this->expectException(MercureException::class);
|
||||
$buildToken->shouldBeCalledOnce();
|
||||
|
||||
$action->handle(ServerRequestFactory::fromGlobals());
|
||||
}
|
||||
|
||||
public function provideValidConfigs(): iterable
|
||||
{
|
||||
yield 'days not defined' => [['public_hub_url' => 'http://foobar.com']];
|
||||
|
||||
Reference in New Issue
Block a user