generated from Setono/SyliusPluginSkeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
73 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Setono\SyliusShipmondoPlugin\Registrar; | ||
|
||
final class Webhook | ||
{ | ||
public function __construct( | ||
public readonly string $name, | ||
public readonly string $endpoint, | ||
public readonly string $key, | ||
public readonly string $action, | ||
public readonly string $resource, | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\Setono\SyliusShipmondoPlugin\Registrar; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Prophecy\Argument; | ||
use Prophecy\PhpUnit\ProphecyTrait; | ||
use Setono\Shipmondo\Client\ClientInterface; | ||
use Setono\SyliusShipmondoPlugin\Registrar\WebhookRegistrar; | ||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface; | ||
|
||
final class WebhookRegistrarTest extends TestCase | ||
{ | ||
use ProphecyTrait; | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function it_returns_version(): void | ||
{ | ||
$client = $this->prophesize(ClientInterface::class); | ||
$urlGenerator = $this->prophesize(UrlGeneratorInterface::class); | ||
$urlGenerator->generate('_webhook_controller', Argument::type('array'), UrlGeneratorInterface::ABSOLUTE_URL)->willReturn('https://example.com/webhook'); | ||
|
||
$registrar = new WebhookRegistrar($client->reveal(), $urlGenerator->reveal(), 'key', 'prefix'); | ||
|
||
self::assertSame('49fb4dab33cd8cf27e6a9d1944dcbbdb', $registrar->getVersion()); | ||
} | ||
} |