Sean’s Obsessions

  • Archives

Archive for February, 2008

29 Feb

Testing via screen scraping

Trying to figure out how to write a test based on screen scraping. Easiest example is to make sure that certain URIs redirect to the login screen.
Created an “automated” dir under app/tests/cases/, with a file called permissions.test.php:

<?php

class PermissionsTestCase extends CakeWebTestCase {

var $mysite = “http://test.mysite.com”;
[…]

29 Feb

How the hell do you test a controller?

Testing models is straightforward, see http://bakery.cakephp.org/articles/view/testing-models-with-cakephp-1-2-test-suite
Testing a controller though… Why is there nothing good out there that tells you how to test a controller, other than references to Felix’s work that doesn’t use simpletest?
That said, testing a controller should look something like
- Create controller object
- Call an action
- Poke at the controller to make […]

© 2008 Sean’s Obsessions | Entries (RSS) and Comments (RSS)

Powered by Wordpress, design by Web4Sudoku, based on Pinkline byGPS Gazette