1

I write Simple code for contqact Form,which contain fields name, email and message. I want to write test cases for it to check user enter fields value are match with the expected value or not. But i m not getting user enter value while I execute 'contactTest.php' file using command "./symfony test:functional frontend contact" Code:

enter code here  
<?php
include('/home/APP/test/bootstrap/functional.php');
$browser = new sfTestFunctional(new sfBrowser());
$browser->
    get('/Contact/thankyou')->
        with('request')->begin()->
        isParameter('module', 'Contact')->
        isParameter('action', 'thankyou')->
        end();
$browser->
get('/Contact/index')->
    click('Submit', array(
    'name'      => 'Test',
    'email'        => 'not.an.email',
    'message'   => 'message'
    ))->

isRedirected()->
followRedirect()->
with('response')->checkElement('#content ul li','Testa');
get('/Contact/thankyou', array('name' => 'Test'));
?>

Please help me to write testcase for checking user enter value in the form and expected value. And also suggest how to run & test?

1
  • How is this related to Functional Programming ? Commented Aug 12, 2011 at 5:28

1 Answer 1

1

It looks to me that you forgot to provide your form object. Can you share your form template?

You probably want something like this :

get('/Contact/index')->
click('Submit', array(
    contact => array(
        'name'      => 'Test',
        'email'        => 'not.an.email',
        'message'   => 'message'
    )
))->
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.