Removed more object casting
This commit is contained in:
@@ -301,19 +301,9 @@ class PageRulesActions implements Configurations
|
||||
|
||||
private function addConfigurationOption(string $setting, array $configuration)
|
||||
{
|
||||
/**
|
||||
* Transforms an, optionally nested, array in to a collection of
|
||||
* stdClass objects.
|
||||
*
|
||||
* @var array $array
|
||||
*/
|
||||
$getArrayAsObject = function (array $array) {
|
||||
return json_decode(json_encode($array));
|
||||
};
|
||||
|
||||
$configuration['id'] = $setting;
|
||||
|
||||
array_push($this->configs, $getArrayAsObject($configuration));
|
||||
array_push($this->configs, $configuration);
|
||||
}
|
||||
|
||||
private function getBoolAsOnOrOff(bool $value): string
|
||||
|
||||
@@ -14,8 +14,8 @@ class PageRulesActionTest extends TestCase
|
||||
$configuration = $actions->getArray();
|
||||
|
||||
$this->assertCount(1, $configuration);
|
||||
$this->assertEquals($identifier, $configuration[0]->id);
|
||||
$this->assertEquals($statusCode, $configuration[0]->value->status_code);
|
||||
$this->assertEquals($forwardingURL, $configuration[0]->value->url);
|
||||
$this->assertEquals($identifier, $configuration[0]['id']);
|
||||
$this->assertEquals($statusCode, $configuration[0]['value']['status_code']);
|
||||
$this->assertEquals($forwardingURL, $configuration[0]['value']['url']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user