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

@@ -1,4 +1,6 @@
<?php
declare(strict_types=1);
namespace codeception\api\unit\validators;
use api\rbac\Permissions as P;
@@ -26,9 +28,8 @@ class PasswordRequiredValidatorTest extends TestCase {
$this->assertNull($this->callProtected($model, 'validateValue', '12345678'));
// Skip validation if user can skip identity verification
/** @var User|\Mockery\MockInterface $component */
$component = mock(User::class . '[can]', [['identityClass' => '']]);
$component->shouldReceive('can')->withArgs([P::ESCAPE_IDENTITY_VERIFICATION])->andReturn(true);
$component = $this->createPartialMock(User::class, ['can']);
$component->method('can')->with(P::ESCAPE_IDENTITY_VERIFICATION)->willReturn(true);
$model->user = $component;
$this->assertNull($this->callProtected($model, 'validateValue', ''));
}