2016-07-17 22:08:04 +05:30
|
|
|
<?php
|
2020-06-12 02:57:02 +05:30
|
|
|
declare(strict_types=1);
|
|
|
|
|
2019-02-21 01:28:52 +05:30
|
|
|
namespace api\tests\functional;
|
2016-07-17 22:08:04 +05:30
|
|
|
|
2019-02-21 01:28:52 +05:30
|
|
|
use api\tests\FunctionalTester;
|
2020-06-12 02:57:02 +05:30
|
|
|
use Codeception\Example;
|
2016-07-17 22:08:04 +05:30
|
|
|
|
|
|
|
class LogoutCest {
|
|
|
|
|
2020-06-12 02:57:02 +05:30
|
|
|
/**
|
|
|
|
* @dataProvider getLogoutCases
|
|
|
|
*/
|
|
|
|
public function logout(FunctionalTester $I, Example $example) {
|
|
|
|
$I->amAuthenticated($example[0]);
|
|
|
|
$I->sendPOST('/api/authentication/logout');
|
2016-07-17 22:08:04 +05:30
|
|
|
$I->canSeeResponseContainsJson([
|
|
|
|
'success' => true,
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
2020-06-12 02:57:02 +05:30
|
|
|
protected function getLogoutCases() {
|
|
|
|
yield 'active account' => ['admin'];
|
|
|
|
yield 'account that not accepted the rules' => ['Veleyaba'];
|
|
|
|
yield 'account marked for deleting' => ['DeletedAccount'];
|
|
|
|
}
|
|
|
|
|
2016-07-17 22:08:04 +05:30
|
|
|
}
|