Projet

Général

Profil

Révision 65389548

Ajouté par Assos Assos il y a plus de 4 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/webform_validation/tests/WebformValidationTestCase.test
46 46

  
47 47
    // Rule creation page.
48 48
    $this->clickLink('Minimum length');
49
    $this->assertTitle('Add validation | Drupal');
49
    $this->assertTitle('Add validation rule | Drupal');
50
    $this->assertText('Minimum length');
50 51
    $element = $this->xpath("//input[@id='edit-data'][@name='data'][@type='text']");
51 52
    $this->assertTrue($element, 'Page contains "edit-data" input.');
52 53

  
......
59 60
    $this->drupalPost(NULL, $values, t('Add rule'));
60 61
    $this->assertText(htmlspecialchars($values['rulename'], ENT_QUOTES), 'Rule name appears on page.');
61 62

  
63
    // Test rule creation validation.
64
    $this->clickLink('Compare two values');
65
    $this->assertTitle('Add validation rule | Drupal');
66
    $this->assertText('Compare two values');
67
    $values = array(
68
      'rulename' => $this->randomString(),
69
      'data' => 'invalid',
70
    );
71
    $this->drupalPost(NULL, $values, t('Add rule'));
72
    $this->assertText('Comparison operator is invalid.', 'Custom data validation fails.');
73
    $this->assertText('You need to select exactly 2 components.', 'Custom data validation fails.');
74
    $this->assertText('Custom error message field is required.', 'Custom data validation fails.');
75

  
76
    $values = array(
77
      'rule_components[20]' => TRUE,
78
      'rule_components[21]' => TRUE,
79
      'data' => '<',
80
      'error_message' => 'Error message.',
81
    );
82
    $this->drupalPost(NULL, $values, t('Add rule'));
83

  
62 84
    $this->clickLink('Webform Validation Testing 1');
63 85
    $element = $this->xpath("//textarea[@id='edit-data'][@name='data']");
64 86
    $this->assertTrue($element, 'Page contains "edit-data" textarea.');

Formats disponibles : Unified diff