PHP Classes
elePHPant
Icontem

File: tests/unit/Del/Field/TextAreaTest.php

Recommend this page to a friend!
  Classes of Derek McLean  >  HTML Forms  >  tests/unit/Del/Field/TextAreaTest.php  >  Download  
File: tests/unit/Del/Field/TextAreaTest.php
Role: Class source
Content type: text/plain
Description: Class source
Class: HTML Forms
Generate and validate submitted HTML forms
Author: By
Last change:
Date: 1 year ago
Size: 870 bytes
 

 

Contents

Class file image Download
<?php

namespace DelTesting\Form\Field;

use
Codeception\TestCase\Test;
use
Del\Form\Form;
use
Del\Form\Field\TextArea;

/**
 * User: delboy1978uk
 * Date: 05/12/2016
 * Time: 02:27
 */
class TextAreaTest extends Test
{

    public function
testRenderTextArea()
    {
       
$form = new Form('required-text-form');
       
$text = new TextArea('text');
       
$text->setPlaceholder('Type something..');
       
$text->setValue('hello');
       
$form->addField($text);
       
$html = $form->render();
       
$this->assertEquals('Type something..', $text->getPlaceholder());
       
$this->assertEquals('<form name="required-text-form" method="post" id="required-text-form"><div class="form-group" id="text-form-group"><label for=""></label><textarea name="text" class="form-control" placeholder="Type something..">hello</textarea></div></form>'."\n", $html);
    }
}