Skip to content

Commit

Permalink
ACMS-000: Fixed failing PHPUnit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalkhode1 committed Nov 21, 2023
1 parent a1fd67d commit 30242a0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 22 deletions.
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
"Acquia\\Drupal\\RecommendedSettings\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Acquia\\Drupal\\RecommendedSettings\\Tests\\": "tests/src"
}
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
Expand Down
24 changes: 4 additions & 20 deletions src/Config/SettingsConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,9 @@ public function replaceFileVariables(string $filename): void {
}

/**
* Set a config value.
*
* @param string $key
* The config key.
* @param mixed $value
* The config value.
*
* @return $this
* {@inheritdoc}
*/
public function set(string $key, mixed $value) {
public function set($key, $value) {
if ($value === 'false') {
$value = FALSE;
}
Expand All @@ -70,18 +63,9 @@ public function set(string $key, mixed $value) {
}

/**
* Fetch a configuration value.
*
* @param string $key
* Which config item to look up.
* @param string|null $defaultOverride
* Override usual default value with a different default. Deprecated;
* provide defaults to the config processor instead.
*
* @return mixed
* Mixed.
* {@inheritdoc}
*/
public function get(string $key, ?string $defaultOverride = NULL): mixed {
public function get($key, $defaultOverride = NULL) {
$value = parent::get($key, $defaultOverride);

// Last ditch effort to expand properties that may not have been processed.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Acquia\Drupal\RecommendedSettings\Tests;
namespace Acquia\Drupal\RecommendedSettings\Tests\unit;

use Acquia\Drupal\RecommendedSettings\Helpers\Filesystem as DrsFilesystem;
use Acquia\Drupal\RecommendedSettings\Settings;
Expand All @@ -12,7 +12,7 @@ class SettingsTest extends TestCase {
/**
* The recommended settings object.
*/
protected string $settings;
protected Settings $settings;

/**
* The path to drupal webroot directory.
Expand Down

0 comments on commit 30242a0

Please sign in to comment.