mirror of
https://github.com/elyby/accounts.git
synced 2024-12-28 16:10:40 +05:30
Зафиксирована стабильная версия Codeception 2.1.10
Обновлены моки для будущей совместимости с Codeception 2.2
This commit is contained in:
parent
649216a225
commit
52f115a4e9
@ -31,7 +31,7 @@
|
|||||||
"yiisoft/yii2-gii": "*",
|
"yiisoft/yii2-gii": "*",
|
||||||
"yiisoft/yii2-faker": "*",
|
"yiisoft/yii2-faker": "*",
|
||||||
"flow/jsonpath": "^0.3.1",
|
"flow/jsonpath": "^0.3.1",
|
||||||
"codeception/codeception": "2.1.x-dev",
|
"codeception/codeception": "~2.1.10",
|
||||||
"codeception/specify": "*",
|
"codeception/specify": "*",
|
||||||
"codeception/verify": "*"
|
"codeception/verify": "*"
|
||||||
},
|
},
|
||||||
|
@ -84,7 +84,6 @@ class OauthAuthCodeCest {
|
|||||||
$I->loggedInAsActiveAccount();
|
$I->loggedInAsActiveAccount();
|
||||||
|
|
||||||
$I->wantTo('get accept_required if I dom\'t require any scope, but this is first time request');
|
$I->wantTo('get accept_required if I dom\'t require any scope, but this is first time request');
|
||||||
$I->cleanupRedis();
|
|
||||||
$this->route->complete($this->buildQueryParams(
|
$this->route->complete($this->buildQueryParams(
|
||||||
'ely',
|
'ely',
|
||||||
'http://ely.by',
|
'http://ely.by',
|
||||||
|
@ -102,14 +102,21 @@ class ComponentTest extends DbTestCase {
|
|||||||
$this->component->logout();
|
$this->component->logout();
|
||||||
|
|
||||||
/** @var Component|\PHPUnit_Framework_MockObject_MockObject $component */
|
/** @var Component|\PHPUnit_Framework_MockObject_MockObject $component */
|
||||||
$component = $this->getMock(Component::class, ['getIsGuest'], [$this->getComponentArguments()]);
|
$component = $this->getMockBuilder(Component::class)
|
||||||
|
->setMethods(['getIsGuest'])
|
||||||
|
->setConstructorArgs([$this->getComponentArguments()])
|
||||||
|
->getMock();
|
||||||
|
|
||||||
$component
|
$component
|
||||||
->expects($this->any())
|
->expects($this->any())
|
||||||
->method('getIsGuest')
|
->method('getIsGuest')
|
||||||
->will($this->returnValue(false));
|
->will($this->returnValue(false));
|
||||||
|
|
||||||
/** @var HeaderCollection|\PHPUnit_Framework_MockObject_MockObject $headersCollection */
|
/** @var HeaderCollection|\PHPUnit_Framework_MockObject_MockObject $headersCollection */
|
||||||
$headersCollection = $this->getMock(HeaderCollection::class, ['get']);
|
$headersCollection = $this->getMockBuilder(HeaderCollection::class)
|
||||||
|
->setMethods(['get'])
|
||||||
|
->getMock();
|
||||||
|
|
||||||
$headersCollection
|
$headersCollection
|
||||||
->expects($this->any())
|
->expects($this->any())
|
||||||
->method('get')
|
->method('get')
|
||||||
@ -117,7 +124,10 @@ class ComponentTest extends DbTestCase {
|
|||||||
->will($this->returnValue('Bearer ' . $result->getJwt()));
|
->will($this->returnValue('Bearer ' . $result->getJwt()));
|
||||||
|
|
||||||
/** @var Request|\PHPUnit_Framework_MockObject_MockObject $request */
|
/** @var Request|\PHPUnit_Framework_MockObject_MockObject $request */
|
||||||
$request = $this->getMock(Request::class, ['getHeaders']);
|
$request = $this->getMockBuilder(Request::class)
|
||||||
|
->setMethods(['getHeaders'])
|
||||||
|
->getMock();
|
||||||
|
|
||||||
$request
|
$request
|
||||||
->expects($this->any())
|
->expects($this->any())
|
||||||
->method('getHeaders')
|
->method('getHeaders')
|
||||||
@ -166,7 +176,10 @@ class ComponentTest extends DbTestCase {
|
|||||||
* @return \PHPUnit_Framework_MockObject_MockObject
|
* @return \PHPUnit_Framework_MockObject_MockObject
|
||||||
*/
|
*/
|
||||||
private function mockRequest($userIP = '127.0.0.1') {
|
private function mockRequest($userIP = '127.0.0.1') {
|
||||||
$request = $this->getMock(Request::class, ['getHostInfo', 'getUserIP']);
|
$request = $this->getMockBuilder(Request::class)
|
||||||
|
->setMethods(['getHostInfo', 'getUserIP'])
|
||||||
|
->getMock();
|
||||||
|
|
||||||
$request
|
$request
|
||||||
->expects($this->any())
|
->expects($this->any())
|
||||||
->method('getHostInfo')
|
->method('getHostInfo')
|
||||||
|
@ -100,12 +100,15 @@ class ChangePasswordFormTest extends DbTestCase {
|
|||||||
|
|
||||||
public function testChangePasswordWithLogout() {
|
public function testChangePasswordWithLogout() {
|
||||||
/** @var Component|\PHPUnit_Framework_MockObject_MockObject $component */
|
/** @var Component|\PHPUnit_Framework_MockObject_MockObject $component */
|
||||||
$component = $this->getMock(Component::class, ['getActiveSession'], [[
|
$component = $this->getMockBuilder(Component::class)
|
||||||
|
->setMethods(['getActiveSession'])
|
||||||
|
->setConstructorArgs([[
|
||||||
'identityClass' => AccountIdentity::class,
|
'identityClass' => AccountIdentity::class,
|
||||||
'enableSession' => false,
|
'enableSession' => false,
|
||||||
'loginUrl' => null,
|
'loginUrl' => null,
|
||||||
'secret' => 'secret',
|
'secret' => 'secret',
|
||||||
]]);
|
]])
|
||||||
|
->getMock();
|
||||||
|
|
||||||
/** @var AccountSession $session */
|
/** @var AccountSession $session */
|
||||||
$session = AccountSession::findOne($this->accountSessions['admin2']['id']);
|
$session = AccountSession::findOne($this->accountSessions['admin2']['id']);
|
||||||
|
@ -37,7 +37,7 @@ class ChangeUsernameFormTest extends DbTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function testChangeWithoutChange() {
|
public function testChangeWithoutChange() {
|
||||||
$this->scenario->incomplete('This test is written invalid');
|
$this->markTestSkipped('This test is written invalid');
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// TODO: этот тест написан неправильно - запись всё равно добавляется в базу данных, но тест не замечает
|
// TODO: этот тест написан неправильно - запись всё равно добавляется в базу данных, но тест не замечает
|
||||||
|
Loading…
Reference in New Issue
Block a user