You are here

function AWSSDKUIUnitTest::testUI in AWS SDK for PHP 7.4

Ensure the UI settings match those provided by the SDK.

File

ui/awssdk_ui.test, line 21
Provide tests.

Class

AWSSDKUIUnitTest
@file Provide tests.

Code

function testUI() {

  // Load the default settings keys and ensure that they loaded properly.
  $defaults = array_keys(awssdk_config_defaults());
  $this
    ->assertTrue($defaults, count($defaults) . ' default settings loaded.');

  // Load the UI form and get the settings keys.
  $form_state = array();
  $form = awssdk_ui_settings_form(array(), $form_state);

  // Get the children of the form and remove the actions buttons.
  $children = element_children($form);
  array_pop($children);
  if (!$this
    ->assertEqual($defaults, $children, 'The settings provided by the UI are indentical to those provided by the SDK.')) {
    debug(array_diff($defaults, $children));
  }
}