<?php

/**
 * @file
 * Tests for {{ name }}.module.
 */

/**
 * Tests the functionality of the {{ name }} module.
 */
class {{ class }} extends DrupalWebTestCase {

  /**
   * A user with permission to administer {{ machine_name }} configuration.
   *
   * @var object
   */
  protected $admin_user;

  public static function getInfo() {
    return array(
      'name' => '{{ name }}',
      'description' => 'Test description',
      'group' => '{{ machine_name }}',
    );
  }

  function setUp() {
    parent::setUp(array('{{ machine_name }}'));

    // Create admin account.
    $this->admin_user = $this->drupalCreateUser(array('administer {{ machine_name }} configuration'));

    $this->drupalLogin($this->admin_user);
  }

  /**
   * Tests configuration form.
   */
  function testAdminForm() {
    $fields = array(
      '{{ machine_name }}_setting_1' => 'test',
      '{{ machine_name }}_setting_2' => 1,
      '{{ machine_name }}_setting_3' => 1,
    );
    $this->drupalPost('admin/config/system/{{ machine_name }}', $fields, t('Save configuration'));

    $this->assertFieldByName('{{ machine_name }}_setting_1', 'test');
    $this->assertFieldByName('{{ machine_name }}_setting_2', 1);
    $this->assertFieldByName('{{ machine_name }}_setting_3', 1);
    $this->assertRaw(t('The configuration options have been saved.'));
  }

}
