Skip to content

Commit

Permalink
ACMS-3366: PHP unit existing test fixes due to sitestudio 7.4.x version.
Browse files Browse the repository at this point in the history
  • Loading branch information
apathak18 authored and chandan-singh7929 committed Dec 4, 2023
1 parent 987e28b commit 4532af0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function setUp(): void {
* @throws \Drupal\Core\Extension\ExtensionNameLengthException
* @throws \Drupal\Core\Extension\MissingDependencyException
*/
public function testSiteStudioVersionFromState() {
public function testSiteStudioVersionFromState(): void {
$extension = $this->moduleExtensionList->get("cohesion")->info;
$this->assertSame($extension['version'], $this->state->get("sitestudio_config_management.site_studio_version"));
$this->moduleInstaller->uninstall(['sitestudio_config_management']);
Expand All @@ -80,7 +80,7 @@ public function testSiteStudioVersionFromState() {
/**
* Tests the current/previous Site Studio version.
*/
public function testSiteStudioVersions() {
public function testSiteStudioVersions(): void {
$this->assertNotEmpty($this->siteStudioConfigService->getCurrentVersion());
$this->assertNotEmpty($this->siteStudioConfigService->getPreviousVersion());
$this->assertSame($this->siteStudioConfigService->getCurrentVersion(), $this->siteStudioConfigService->getPreviousVersion());
Expand All @@ -92,7 +92,7 @@ public function testSiteStudioVersions() {
* @throws \Drupal\Core\Extension\ExtensionNameLengthException
* @throws \Drupal\Core\Extension\MissingDependencyException
*/
public function testSiteStudioUpgraded() {
public function testSiteStudioUpgraded(): void {
$this->assertFalse($this->siteStudioConfigService->isSiteStudioUpgraded());
$this->state->set("sitestudio_config_management.site_studio_version", "8.x-6.8.2");
$this->assertTrue($this->siteStudioConfigService->isSiteStudioUpgraded());
Expand All @@ -101,7 +101,7 @@ public function testSiteStudioUpgraded() {
/**
* Tests to validate if Site Studio is configured.
*/
public function testSiteStudioConfigured() {
public function testSiteStudioConfigured(): void {
$this->assertFalse($this->siteStudioConfigService->isSiteStudioConfigured());
$this->config("cohesion.settings")
->set("api_key", "some-api-url")
Expand Down
9 changes: 9 additions & 0 deletions tests/src/ExistingSiteJavascript/CohesionTestBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,20 @@ abstract class CohesionTestBase extends ExistingSiteSelenium2DriverTestBase {
MediaTestTrait::createMedia as traitCreateMedia;
}

/**
* The module_installer service object.
*
* @var \Drupal\Core\Extension\ModuleInstaller
*/
protected $moduleInstaller;

/**
* {@inheritdoc}
*/
protected function setUp(): void {
parent::setUp();
$this->moduleInstaller = $this->container->get('module_installer');
$this->moduleInstaller->install(['sitestudio_claro']);
// Set a standard window size so that all javascript tests start with the
// same viewport.
$this->getDriverInstance()->maximizeWindow();
Expand Down

0 comments on commit 4532af0

Please sign in to comment.