mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Rework the webhooks table, allow to update exists webhooks
This commit is contained in:
19
common/tests/fixtures/WebHooksEventsFixture.php
vendored
19
common/tests/fixtures/WebHooksEventsFixture.php
vendored
@@ -1,19 +0,0 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace common\tests\fixtures;
|
||||
|
||||
use common\models\WebHookEvent;
|
||||
use yii\test\ActiveFixture;
|
||||
|
||||
class WebHooksEventsFixture extends ActiveFixture {
|
||||
|
||||
public $modelClass = WebHookEvent::class;
|
||||
|
||||
public $dataFile = '@root/common/tests/fixtures/data/webhooks-events.php';
|
||||
|
||||
public $depends = [
|
||||
WebHooksFixture::class,
|
||||
];
|
||||
|
||||
}
|
11
common/tests/fixtures/data/webhooks-events.php
vendored
11
common/tests/fixtures/data/webhooks-events.php
vendored
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
return [
|
||||
[
|
||||
'webhook_id' => 1,
|
||||
'event_type' => 'account.edit',
|
||||
],
|
||||
[
|
||||
'webhook_id' => 2,
|
||||
'event_type' => 'account.edit',
|
||||
],
|
||||
];
|
3
common/tests/fixtures/data/webhooks.php
vendored
3
common/tests/fixtures/data/webhooks.php
vendored
@@ -4,18 +4,21 @@ return [
|
||||
'id' => 1,
|
||||
'url' => 'http://localhost:80/webhooks/ely',
|
||||
'secret' => 'my-secret',
|
||||
'events' => ['account.edit'],
|
||||
'created_at' => 1531054333,
|
||||
],
|
||||
'webhook-without-secret' => [
|
||||
'id' => 2,
|
||||
'url' => 'http://localhost:81/webhooks/ely',
|
||||
'secret' => null,
|
||||
'events' => ['account.edit'],
|
||||
'created_at' => 1531054837,
|
||||
],
|
||||
'webhook-without-events' => [
|
||||
'id' => 3,
|
||||
'url' => 'http://localhost:82/webhooks/ely',
|
||||
'secret' => null,
|
||||
'events' => [],
|
||||
'created_at' => 1531054990,
|
||||
],
|
||||
];
|
||||
|
@@ -18,7 +18,6 @@ class CreateWebHooksDeliveriesTest extends TestCase {
|
||||
public function _fixtures(): array {
|
||||
return [
|
||||
'webhooks' => fixtures\WebHooksFixture::class,
|
||||
'webhooksEvents' => fixtures\WebHooksEventsFixture::class,
|
||||
];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user