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
|
|
|
|
*/
|
2024-12-02 15:40:55 +05:30
|
|
|
public function logout(FunctionalTester $I, Example $example): void {
|
2020-06-12 02:57:02 +05:30
|
|
|
$I->amAuthenticated($example[0]);
|
|
|
|
$I->sendPOST('/api/authentication/logout');
|
2016-07-17 22:08:04 +05:30
|
|
|
$I->canSeeResponseContainsJson([
|
|
|
|
'success' => true,
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
2024-12-02 15:40:55 +05:30
|
|
|
protected function getLogoutCases(): iterable {
|
2020-06-12 02:57:02 +05:30
|
|
|
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
|
|
|
}
|