You are here

public function AcquiadamConfigFormTest::testBuildForm in Media: Acquia DAM 8

@covers ::buildForm

File

tests/src/Unit/AcquiadamConfigFormTest.php, line 74

Class

AcquiadamConfigFormTest
Config form test.

Namespace

Drupal\Tests\media_acquiadam\Unit

Code

public function testBuildForm() {
  $form = $this->acquiaDamConfig
    ->buildForm([], new FormState());
  $this
    ->assertArrayHasKey('authentication', $form);
  $this
    ->assertArrayHasKey('username', $form['authentication']);
  $this
    ->assertArrayHasKey('password', $form['authentication']);
  $this
    ->assertArrayHasKey('client_id', $form['authentication']);
  $this
    ->assertArrayHasKey('secret', $form['authentication']);
  $this
    ->assertEquals('WDusername', $form['authentication']['username']['#default_value']);
  $this
    ->assertEquals('WDpassword', $form['authentication']['password']['#default_value']);
  $this
    ->assertEquals('WDclient-id', $form['authentication']['client_id']['#default_value']);
  $this
    ->assertEquals('WDsecret', $form['authentication']['secret']['#default_value']);
  $this
    ->assertArrayHasKey('cron', $form);
  $this
    ->assertEquals('14400', $form['cron']['sync_interval']['#default_value']);
  $this
    ->assertEquals(1, $form['cron']['notifications_sync']['#default_value']);
  $this
    ->assertArrayHasKey('image', $form);
  $this
    ->assertEquals(1280, $form['image']['size_limit']['#default_value']);
  $this
    ->assertArrayHasKey('manual_sync', $form);
  $this
    ->assertArrayHasKey('perform_manual_sync', $form['manual_sync']);
}