Get rid of mockery library. Still have some troubles with functional tests for api

This commit is contained in:
ErickSkrauch
2019-12-14 00:16:05 +03:00
parent d9ef27b745
commit e8b71d33d0
37 changed files with 217 additions and 374 deletions

View File

@@ -22,9 +22,8 @@ class AccountOwnerTest extends TestCase {
$this->assertFalse($rule->execute('some token', $item, ['accountId' => 123]));
// Identity presented, but have no account
/** @var IdentityInterface|\Mockery\MockInterface $identity */
$identity = mock(IdentityInterface::class);
$identity->shouldReceive('getAccount')->andReturn(null);
$identity = $this->createMock(IdentityInterface::class);
$identity->method('getAccount')->willReturn(null);
Yii::$app->user->setIdentity($identity);
$this->assertFalse($rule->execute('some token', $item, ['accountId' => 123]));
@@ -35,9 +34,8 @@ class AccountOwnerTest extends TestCase {
$account->status = Account::STATUS_ACTIVE;
$account->rules_agreement_version = LATEST_RULES_VERSION;
/** @var IdentityInterface|\Mockery\MockInterface $identity */
$identity = mock(IdentityInterface::class);
$identity->shouldReceive('getAccount')->andReturn($account);
$identity = $this->createMock(IdentityInterface::class);
$identity->method('getAccount')->willReturn($account);
Yii::$app->user->setIdentity($identity);