| [ Index ] |
PHP Cross Reference of Web Application Component Toolkit |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * @package WACT_TESTS 4 * @version $Id: errors.test.php,v 1.7 2004/10/16 20:28:39 jeffmoore Exp $ 5 */ 6 7 /** 8 * @package WACT_TESTS 9 */ 10 class ErrorsTestCase extends WACTWebTestCase { 11 function ErrorsTestCase($name = 'ErrorsTestCase') { 12 $this->WACTWebTestCase($name); 13 } 14 15 /* function testCompileAll() { */ 16 /* $this->get(TEST_HTTP_PATH . '/errors/compileall.php'); */ 17 /* $this->assertWantedPattern( */ 18 /* $this->_fileToPattern(TEST_HTTP_PATH . '/errors/expected_output/compileall.html')); */ 19 /* } */ 20 21 function testBadSelfNestingTag() { 22 $this->get(TEST_HTTP_PATH . '/errors/badselfnestingtag.php'); 23 $this->assertWantedPattern('/Tag \'form\' cannot be nested within another \'form\' tag in template file \'.*\' on line 10/'); 24 } 25 function testComponentNotFound() { 26 $this->get(TEST_HTTP_PATH . '/errors/componentnotfound.php'); 27 $this->assertWantedPattern('/Could not find component \'nonexistent\' in template file \'.*\'/'); 28 } 29 function testControlArrayRequired() { 30 $this->get(TEST_HTTP_PATH . '/errors/controlarrayrequired.php'); 31 $this->assertWantedPattern('/Array required in name attribute \'testselect\' for SELECT tag with multiple attribute in template file \'.*\' on line 9/'); 32 } 33 function testDuplicateID() { 34 $this->get(TEST_HTTP_PATH . '/errors/duplicateid.php'); 35 $this->assertWantedPattern('/Duplicate id \'dup\' for tag \'INPUT\' in template file \'.*\' on line 11/'); 36 } 37 38 function testExpectingGT() { 39 $this->get(TEST_HTTP_PATH . '/errors/expectinggt.php'); 40 $this->assertWantedPattern('/Closing tag not found for tag \'form\' in template file \'.*\' on line 9/'); 41 } 42 43 function testInvalidFileName() { 44 $this->get(TEST_HTTP_PATH . '/errors/invalidfilename.php'); 45 $this->assertWantedPattern('/' . 46 preg_quote('Invalid filename \'../invalidfilename.html\' (may not contain \'//\' or \'..\')', '/') . 47 '/'); 48 } 49 function testMissingClose() { 50 $this->get(TEST_HTTP_PATH . '/errors/missingclose.php'); 51 $this->assertWantedPattern('/Closing tag not found for tag \'core:block\' in template file \'.*\' on line 8/'); 52 } 53 function testMissingEnclosure() { 54 $this->get(TEST_HTTP_PATH . '/errors/missingenclosure.php'); 55 $this->assertWantedPattern('/\'list:item\' tag must be enclosed by a \'list:LIST or ERRORSUMMARY\' tag in template file \'.*\' on line 9/'); 56 } 57 function testMissingFile() { 58 $this->get(TEST_HTTP_PATH . '/errors/missingfile.php'); 59 $this->assertWantedPattern('/Unable to resolve \'missingfile2.html\' to a valid source file for tag \'core:import\' in template file \'.*\' on line 8/'); 60 } 61 function testMissingFile2() { 62 $this->get(TEST_HTTP_PATH . '/errors/missingfile2.php'); 63 $this->assertWantedPattern('/Unable to resolve \'\/missingfile2.html\' to a valid import source file/'); 64 } 65 function testMissingRequiredAttribute() { 66 $this->get(TEST_HTTP_PATH . '/errors/missingrequiredattribute.php'); 67 $this->assertWantedPattern('/Missing required attribute \'file\' for tag \'core:import\' in template file \'.*\' on line 8/'); 68 } 69 function testRelativePath() { 70 $this->get(TEST_HTTP_PATH . '/errors/relativepath.php'); 71 $this->assertWantedPattern('/Relative path not allowed: \'relativepath\/relativepath.html\'/'); 72 } 73 function testUnknownInputType() { 74 $this->get(TEST_HTTP_PATH . '/errors/unknowninputtype.php'); 75 $this->assertWantedPattern('/Unrecognized type attribute for input tag in template file \'.*\' on line 10/'); 76 } 77 function testValueNotFound() { 78 $this->get(TEST_HTTP_PATH . '/errors/valuenotfound.php'); 79 $this->assertWantedPattern('/Configuration file \'invalidfilename.php\' not foun/'); 80 } 81 } 82 ?>
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 |