lundi 20 juin 2016

How to unit test for non UTF-8 , empty forms and non string input in Laravel form?

Here is my form ,I need to create test method for non UTF-8 , empty forms and non string input .

To be more specific I don't want to change the form or similar , I need to write a test unit for non UTF8 INPUT ,EMPTY form ,non string input .And I'm not sure how to do that in Laravel? Please help.

<form  method="POST" action=" "> 
        <input name="_token" type="hidden" value=""/>

    <ul class="list-group" >


        <li  >
        NAme
        <div class="form-group" title="email" >
            <textarea name="name" class="form-control" >

            </textarea>
        </div>
        </li  >

        <li>Email
        <div class="form-group" > 
            <textarea name="email"  class="form-control" >

            </textarea>
        </div>
        </li>

        <li  >
            <div class="form-group" >
            <button class="btn btn-primary">Register</button>
            </div>
        </li>

    </ul>
</form>

What scenarios should I test in addition to this mentioned above.?

App does:

User visits home page and fills in the registration form with name and email .

When he clicks the Register button he is save into user table and then he is redirected to page with message "Thank you"



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire