rsfResponseValidatorPlugin
0.1.2alpha
for sf 1.2 MIT
The rsfResponseValidatorPlugin defines a validator that connects to a remote or local W3C mark-up validation service. It can be used to validate all (X)HTML response code from functional testing code.
For now only (X)HTML validation is implemented but support for CSS is planned.
Developers
License
Copyright (c) 2008-2009 Round 84 / Marijn Huizendveld
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Releases for sf 1.2
| Version |
License |
API |
Released |
|
0.1.2alpha
|
MIT license |
0.1.2alpha
|
20/08/2009 |
|
0.1.1alpha
|
MIT license |
0.1.1alpha
|
16/07/2009 |
| Name |
Channel |
Version |
| sfWebBrowserPlugin |
pear.symfony-project.com |
1.1.2- |
Changelog for release 0.1.2 - 20/08/2009
- Added a configuration value to disable validation on an application level.
Other releases
Release 0.1.2 - 20/08/2009
- Added a configuration value to disable validation on an application level.
Release 0.1.1 - 16/07/2009
rsfResponseValidatorPlugin
This plugin is still very much alpha release software, the API might change in the future!
Requirements:
Installation:
You can install the plugin with the symfony installer, by downloading the source
or adding an svn:externals property to your SVN working copy.
Symfony:
$ symfony plugin:install rsfResponseValidatorPlugin
Download:
$ svn checkout http://svn.symfony-project.com/rsfResponseValidatorPlugin/trunk
SVN:
$ svn propset svn:externals "http://svn.symfony-project.com/rsfResponseValidatorPlugin/trunk rsfResponseValidatorPlugin" plugins
After downloading the source code you should clear your symfony cache:
$ php symfony cache:clear --type="config"
Configuration:
The plugin works out of the box but it's best to add these configuration values to your app.yml file. This way you can easily change the configuration after installation.
test:
response_validator:
xhtml_validation_uri: 'http://validator.w3.org/check'
xhtml_validation: true
css_validation_uri: 'http://jigsaw.w3.org/css-validator/validator'
css_validation: true
web_browser_class: 'sfWebBrowser'
Usage:
When you bootstrap your functional test browser add the customized response tester like this:
$browser = new sfTestFunctional(new sfBrowser(), array('response' => 'rsfTesterResponse'));
CSS validation is not yet supported
Now you can call the isValidXhtml(), isValidCss() and isValidResponse()
methods within the response context:
// the isValidResponse method calls both isValidXhtml and isValidCss
$browser
->get('/')
->with('response')->begin()
->isValidXhtml()
->isValidCss()
->end();
Afterwords you should be able to test your code with response validation.
$ symfony test:functional <AppName> <ControllerName>