mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Fix tests
This commit is contained in:
@@ -5,7 +5,9 @@ namespace api\tests\unit\modules\accounts\models;
|
||||
|
||||
use api\modules\accounts\models\DeleteAccountForm;
|
||||
use api\tests\unit\TestCase;
|
||||
use Codeception\Util\ReflectionHelper;
|
||||
use common\models\Account;
|
||||
use common\notifications\AccountEditNotification;
|
||||
use common\tasks\CreateWebHooksDeliveries;
|
||||
use common\tasks\DeleteAccount;
|
||||
use common\tests\fixtures\AccountFixture;
|
||||
@@ -46,7 +48,12 @@ class DeleteAccountFormTest extends TestCase {
|
||||
->method('push')
|
||||
->withConsecutive(
|
||||
[$this->callback(function(CreateWebHooksDeliveries $task) use ($account): bool {
|
||||
$this->assertSame($account->id, $task->payloads['id']);
|
||||
/** @var AccountEditNotification $notification */
|
||||
$notification = ReflectionHelper::readPrivateProperty($task, 'notification');
|
||||
$this->assertInstanceOf(AccountEditNotification::class, $notification);
|
||||
$this->assertSame($account->id, $notification->getPayloads()['id']);
|
||||
$this->assertTrue($notification->getPayloads()['isDeleted']);
|
||||
|
||||
return true;
|
||||
})],
|
||||
[$this->callback(function(DeleteAccount $task) use ($account): bool {
|
||||
|
@@ -5,7 +5,9 @@ namespace api\tests\unit\modules\accounts\models;
|
||||
|
||||
use api\modules\accounts\models\RestoreAccountForm;
|
||||
use api\tests\unit\TestCase;
|
||||
use Codeception\Util\ReflectionHelper;
|
||||
use common\models\Account;
|
||||
use common\notifications\AccountEditNotification;
|
||||
use common\tasks\CreateWebHooksDeliveries;
|
||||
use common\tests\fixtures\AccountFixture;
|
||||
use Yii;
|
||||
@@ -39,7 +41,12 @@ class RestoreAccountFormTest extends TestCase {
|
||||
->method('push')
|
||||
->withConsecutive(
|
||||
[$this->callback(function(CreateWebHooksDeliveries $task) use ($account): bool {
|
||||
$this->assertSame($account->id, $task->payloads['id']);
|
||||
/** @var AccountEditNotification $notification */
|
||||
$notification = ReflectionHelper::readPrivateProperty($task, 'notification');
|
||||
$this->assertInstanceOf(AccountEditNotification::class, $notification);
|
||||
$this->assertSame($account->id, $notification->getPayloads()['id']);
|
||||
$this->assertFalse($notification->getPayloads()['isDeleted']);
|
||||
|
||||
return true;
|
||||
})],
|
||||
);
|
||||
|
Reference in New Issue
Block a user