-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OXDEV-8214 Prepared ThemeSwitch codeception test
- Loading branch information
1 parent
d5287e6
commit bdc0841
Showing
3 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
/** | ||
* Copyright © OXID eSales AG. All rights reserved. | ||
* See LICENSE file for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OxidEsales\GraphQL\ConfigurationAccess\Tests\Codeception\Acceptance\Theme; | ||
|
||
use OxidEsales\GraphQL\ConfigurationAccess\Tests\Codeception\Acceptance\BaseCest; | ||
use OxidEsales\GraphQL\ConfigurationAccess\Tests\Codeception\AcceptanceTester; | ||
|
||
/** | ||
* @group theme_switch | ||
* @group setting_access | ||
* @group oe_graphql_configuration_access | ||
*/ | ||
final class ThemeSwitchCest extends BaseCest | ||
{ | ||
public function testThemeSwitchAuthorized(AcceptanceTester $I): void | ||
{ | ||
$I->login($this->getAdminUsername(), $this->getAdminPassword()); | ||
|
||
$result = $this->runThemeListQuery($I); | ||
|
||
$I->assertArrayNotHasKey('errors', $result); | ||
$response = $result['data']['switchTheme']; | ||
$I->assertTrue($response); | ||
} | ||
|
||
public function runThemeListQuery(AcceptanceTester $I): array | ||
{ | ||
$themeId = $this->getThemeId(); | ||
|
||
$I->login($this->getAdminUsername(), $this->getAdminPassword()); | ||
$I->sendGQLQuery( | ||
'mutation switchThemeCest{ | ||
switchTheme(identifier: "' . $themeId . '") | ||
}' | ||
); | ||
|
||
$I->seeResponseIsJson(); | ||
return $I->grabJsonResponseAsArray(); | ||
} | ||
} |