Ejemplo n.º 1
0
 public function test_display_input_text_with_value_and_id()
 {
     $name = 'test-input-autre';
     $value = "ma valeur 2";
     $id = "id-input";
     $args = array('class' => 'test_class');
     $section = null;
     $text = new Text($name, $value, $id, $args, $section);
     $html_input = $text->getDisplay();
     $this->assertRegExp('/<input type=\\"text\\"/', $html_input);
     $this->assertRegExp('/name=\\"' . $name . '\\"/', $html_input);
     $input_name = $text->getName();
     $this->assertTrue($name === $input_name);
     $this->assertRegExp('/value=\\"' . $value . '\\"/', $html_input);
     $this->assertRegExp('/id=\\"' . $id . '\\"/', $html_input);
     $text->setValue('autre valeur');
     $html_input = $text->getDisplay();
     $this->assertRegExp('/value=\\"autre valeur\\"/', $html_input);
 }