<commit_before><?

  namespace Xparse\ElementFinder\Test;

  /**
   * @author <NAME> <<EMAIL>> 12/30/14
   */
  class HelperTest extends \Xparse\ElementFinder\Test\Main {


    public function testFormData() {
      $html = '
        <div>
        <form >
          <input type="text" name="test" value="123"/>
          <select name="sf">
            <option value="1">1</option>
            <option value="2" selected="selected">2</option>
          </select>
          <select name="sc">
            <option value="16">16</option>
            <option value="15">15</option>
          </select>
        </form>
        </div>
      
      ';
      $page = new \Xparse\ElementFinder\ElementFinder($html);
      $formData = \Xparse\ElementFinder\Helper::getDefaultFormData($page, '//form');
      $this->assertCount(3, $formData);
      $this->assertEquals(123, $formData['test']);
      $this->assertEquals(2, $formData['sf']);
      $this->assertEquals(16, $formData['sc']);

    }
  }<commit_msg>test: add textarea and checkbox test<commit_after><?

  namespace Xparse\ElementFinder\Test;

  /**
   * @author <NAME> <<EMAIL>> 12/30/14
   */
  class HelperTest extends \Xparse\ElementFinder\Test\Main {


    public function testFormData() {
      $html = '
        <div>
        <form >
          <input type="text" name="test" value="123"/>
          <select name="sf">
            <option value="1">1</option>
            <option value="2" selected="selected">2</option>
          </select>
          <input type="checkbox" name="captcha" checked="checked" value="1"/>
          <textarea name="text">custom text</textarea>
          <select name="sc">
            <option value="16">16</option>
            <option value="15">15</option>
          </select>
        </form>
        </div>
      
      ';
      $page = new \Xparse\ElementFinder\ElementFinder($html);
      $formData = \Xparse\ElementFinder\Helper::getDefaultFormData($page, '//form');
      $this->assertCount(5, $formData);
      $this->assertEquals(123, $formData['test']);
      $this->assertEquals(2, $formData['sf']);
      $this->assertEquals(1, $formData['captcha']);
      $this->assertEquals('custom text', $formData['text']);
      $this->assertEquals(16, $formData['sc']);

    }

    /**
     * @expectedException \Exception
     */
    public function testInvalidFormPath() {
      $page = new \Xparse\ElementFinder\ElementFinder('<div></div>');
      \Xparse\ElementFinder\Helper::getDefaultFormData($page, '//form');
    }

  }
{'fraction_non_alphanumeric': 0.17932405566600398, 'fraction_numerical': 0.023061630218687873, 'mean_word_length': 2.432469304229195, 'pattern_counts': {'":': 0, '<': 50, '<?xml version=': 0, '>': 58, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6471397', 'n_tokens_mistral': 792, 'n_tokens_neox': 763, 'n_words': 132}