cakephp2-php8/vendors/simpletest/test/real_sites_test.php
pies da79dff7d7 - merged in Brego's SimpleTest implementation, fixed some of the tests (the Folder test fails to delete one of the test directories on my system, so it's not perfectly clean yet)
- Dispatcher sets a Controller::here variable with the real URL used to access the page, so that tag generators can that use an url (linkTo and formTag for example) use the real url, not guess it from the controller and action names which often fails
- Log class works more reliably and a LogError() shortcut function was added
- Nstring class added, to store string-related functions (there are just four yet, including a random password generator and an string-to-array splitter
- SimpleTest library (with Rephlux) included in /vendors; I've tweaked SimpleScorer::inCli() function, because it didn't work on my setup, it should work everywhere now (it checks for empty REQUEST_METHOD, which should only be empty in CLI)

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@248 3807eeeb-6ff5-0310-8944-8be069107fe0
2005-06-18 23:26:35 +00:00

29 lines
No EOL
1.1 KiB
PHP

<?php
// $Id$
require_once(dirname(__FILE__) . '/../web_tester.php');
class LiveSitesTestCase extends WebTestCase {
function testLastCraft() {
$this->assertTrue($this->get('http://www.lastcraft.com'));
$this->assertResponse(array(200));
$this->assertMime(array('text/html'));
$this->clickLink('About');
$this->assertTitle('About Last Craft');
}
function testSourceforge() {
$this->assertTrue($this->get('http://sourceforge.net/'));
$this->setField('words', 'simpletest');
$this->assertTrue($this->clickImageByName('imageField'));
$this->assertTitle('SourceForge.net: Search');
$this->assertTrue($this->clickLink('SimpleTest'));
$this->clickLink('statistics');
$this->assertWantedPattern('/Statistics for the past 7 days/');
$this->assertTrue($this->setField('report', 'Monthly'));
$this->clickSubmit('Change Stats View');
$this->assertWantedPattern('/Statistics for the past \d+ months/');
}
}
?>