photuris
7/13/2010 - 3:02 PM

gistfile1.php

<?php
$browser = new sfTestFunctional(new sfBrowser(), null,
                 array('response' => 'rsfTesterResponse'));

$browser
  //--------------------//
  // Home Page Is Valid //
  //--------------------//
  ->info('Visit Home Page')
  ->get('/')

  ->info('Index goes to the right place')
  ->with('request')->begin()
    ->isParameter('module', 'content')
    ->isParameter('action', 'index')
  ->end()

  ->info('Web server returns proper code, page is correct')
  ->with('response')->begin()
    ->isStatusCode(200)
    ->checkElement('body', '!/This is a temporary page/')
  ->end()

  // Bitchin!!!
  ->info('HTML is W3C valid')
  ->with('response')->begin()
    ->isValidXhtml()
  ->end()
;