| [ Index ] |
PHP Cross Reference of Web Application Component Toolkit |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * @package WACT_TESTS 4 * @version $Id: web.inc.php,v 1.3 2004/11/21 02:42:30 jeffmoore Exp $ 5 */ 6 SimpleTestOptions::ignore('WACTWebTestCase'); 7 /** 8 * @package WACT_TESTS 9 */ 10 class WACTWebTestCase extends WebTestCase { 11 12 function WACTWebTestCase($name = 'WACTWebTestCase') { 13 $this->WebTestCase($name); 14 } 15 16 function assertNormalPage() { 17 $this->assertResponse(array(200)); 18 $this->assertNoUnwantedPattern('/Warning:/i'); 19 $this->assertNoUnwantedPattern('/Error:/i'); 20 $this->assertNoUnwantedPattern('/Fatal error/i'); 21 } 22 23 function assertWantedLiteral($str) { 24 $this->assertWantedPattern('/' . preg_quote($str, '/'). '/'); 25 } 26 27 function assertNoUnWantedLiteral($str) { 28 $this->assertNoUnWantedPattern('/' . preg_quote($str, '/'). '/'); 29 } 30 31 function &_fileToPattern($file) { 32 $file_as_array = file($file); 33 $pattern = '#^'; 34 foreach ($file_as_array as $line) { 35 /* strip trailing newline */ 36 if ($line[strlen($line) - 1] == "\n") { 37 $line = substr($line, 0, strlen($line) - 1); 38 } 39 $line = preg_quote($line, '#'); 40 41 /* replace paths with wildcard */ 42 $line = preg_replace("#'/[^']*#", "'.*", $line); 43 44 $pattern .= $line . '\n'; 45 } 46 /* strip final newline */ 47 $pattern = substr($pattern, 0, strlen($pattern) - 2); 48 $pattern .= '$#i'; 49 return $pattern; 50 } 51 52 } 53 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Sun Nov 28 19:36:09 2004 | Cross-referenced by PHPXref 0.5 |