Changeset 1312
- Timestamp:
- 01/31/08 00:39:27 (10 months ago)
- Files:
-
- trunk/src/main/php/net/stubbles/ipo/request/stubRequestValueErrorXJConfFactory.php (modified) (1 diff)
- trunk/src/test/IntegrationTests.php (modified) (2 diffs)
- trunk/src/test/php/net/stubbles/integration/ValidatorsXJConfTestCase.php (modified) (4 diffs)
- trunk/src/test/php/net/stubbles/integration/stubRequestValueErrorXJConfFactoryTestCase.php (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/ipo/request/stubRequestValueErrorXJConfFactory.php
r1281 r1312 26 26 */ 27 27 protected static $requestValueErrors = null; 28 28 29 /** 30 * refreshes the internal cache of the class 31 */ 32 public static function refresh() 33 { 34 self::$requestValueErrors = null; 35 } 36 29 37 /** 30 38 * constructor trunk/src/test/IntegrationTests.php
r1308 r1312 12 12 } 13 13 14 define('TEST_SRC_PATH', dirname(__FILE__)); 14 if (defined('TEST_SRC_PATH') === false) { 15 define('TEST_SRC_PATH', dirname(__FILE__)); 16 } 17 15 18 require_once TEST_SRC_PATH . '/../../config/php/config.php'; 16 19 require_once stubConfig::getSourcePath() . '/php/net/stubbles/stubClassLoader.php'; … … 59 62 $suite->addTestFile($dir . '/RegistryTestCase.php'); 60 63 $suite->addTestFile($dir . '/stubPageXJConfFactoryTestCase.php'); 61 #$suite->addTestFile($dir . '/stubRequestValueErrorXJConfFactoryTestCase.php');62 #$suite->addTestFile($dir . '/ValidatorsXJConfTestCase.php');64 $suite->addTestFile($dir . '/stubRequestValueErrorXJConfFactoryTestCase.php'); 65 $suite->addTestFile($dir . '/ValidatorsXJConfTestCase.php'); 63 66 $suite->addTestFile($dir . '/VariantManagerTestCase.php'); 64 67 return $suite; trunk/src/test/php/net/stubbles/integration/ValidatorsXJConfTestCase.php
r1220 r1312 16 16 * @subpackage test_integration 17 17 */ 18 class ValidatorsXJConfTestCase extends UnitTestCase18 class ValidatorsXJConfTestCase extends PHPUnit_Framework_TestCase 19 19 { 20 20 /** … … 37 37 /** 38 38 * assure that a contains validator is created correct 39 */ 40 public function testContainsValidator() 39 * 40 * @test 41 */ 42 public function containsValidator() 41 43 { 42 44 $equalValidator = $this->xjconf->getConfigValue('contains'); 43 $this->assert IsA($equalValidator, 'stubContainsValidator');44 $this->assertEqual ($equalValidator->getCriteria(), array('contained' => 'foo'));45 $this->assertType('stubContainsValidator', $equalValidator); 46 $this->assertEquals(array('contained' => 'foo'), $equalValidator->getCriteria()); 45 47 } 46 48 47 49 /** 48 50 * assure that an equal validator is created correct 49 */ 50 public function testEqualValidator() 51 * 52 * @test 53 */ 54 public function equalValidator() 51 55 { 52 56 $equalValidator = $this->xjconf->getConfigValue('equal'); 53 $this->assert IsA($equalValidator, 'stubEqualValidator');54 $this->assertEqual ($equalValidator->getCriteria(), array('expected' => 3));57 $this->assertType('stubEqualValidator', $equalValidator); 58 $this->assertEquals(array('expected' => 3), $equalValidator->getCriteria()); 55 59 } 56 60 57 61 /** 58 62 * assure that an ip validator is created correct 59 */ 60 public function testIPValidator() 63 * 64 * @test 65 */ 66 public function ipValidator() 61 67 { 62 68 $ipValidator = $this->xjconf->getConfigValue('ip'); 63 $this->assert IsA($ipValidator, 'stubIPValidator');69 $this->assertType('stubIPValidator', $ipValidator); 64 70 } 65 71 66 72 /** 67 73 * assure that a mail validator is created correct 68 */ 69 public function testMailValidator() 74 * 75 * @test 76 */ 77 public function mailValidator() 70 78 { 71 79 $mailValidator = $this->xjconf->getConfigValue('mail'); 72 $this->assert IsA($mailValidator, 'stubMailValidator');80 $this->assertType('stubMailValidator', $mailValidator); 73 81 } 74 82 75 83 /** 76 84 * assure that a max length validator is created correct 77 */ 78 public function testMaxLengthValidator() 85 * 86 * @test 87 */ 88 public function maxLengthValidator() 79 89 { 80 90 $maxLengthValidator = $this->xjconf->getConfigValue('maxLength'); 81 $this->assert IsA($maxLengthValidator, 'stubMaxLengthValidator');82 $this->assertEqual ($maxLengthValidator->getCriteria(), array('maxLength' => 4));91 $this->assertType('stubMaxLengthValidator', $maxLengthValidator); 92 $this->assertEquals(array('maxLength' => 4), $maxLengthValidator->getCriteria()); 83 93 } 84 94 85 95 /** 86 96 * assure that a max number validator is created correct 87 */ 88 public function testMaxNumberValidator() 97 * 98 * @test 99 */ 100 public function maxNumberValidator() 89 101 { 90 102 $maxNumberValidator = $this->xjconf->getConfigValue('maxNumber'); 91 $this->assert IsA($maxNumberValidator, 'stubMaxNumberValidator');92 $this->assertEqual ($maxNumberValidator->getCriteria(), array('maxNumber' => 5));103 $this->assertType('stubMaxNumberValidator', $maxNumberValidator); 104 $this->assertEquals(array('maxNumber' => 5), $maxNumberValidator->getCriteria()); 93 105 } 94 106 95 107 /** 96 108 * assure that a min length validator is created correct 97 */ 98 public function testMinLengthValidator() 109 * 110 * @test 111 */ 112 public function minLengthValidator() 99 113 { 100 114 $minLengthValidator = $this->xjconf->getConfigValue('minLength'); 101 $this->assert IsA($minLengthValidator, 'stubMinLengthValidator');102 $this->assertEqual ($minLengthValidator->getCriteria(), array('minLength' => 4));115 $this->assertType('stubMinLengthValidator', $minLengthValidator); 116 $this->assertEquals(array('minLength' => 4), $minLengthValidator->getCriteria()); 103 117 } 104 118 105 119 /** 106 120 * assure that a min number validator is created correct 107 */ 108 public function testMinNumberValidator() 121 * 122 * @test 123 */ 124 public function minNumberValidator() 109 125 { 110 126 $minNumberValidator = $this->xjconf->getConfigValue('minNumber'); 111 $this->assert IsA($minNumberValidator, 'stubMinNumberValidator');112 $this->assertEqual ($minNumberValidator->getCriteria(), array('minNumber' => 5));127 $this->assertType('stubMinNumberValidator', $minNumberValidator); 128 $this->assertEquals(array('minNumber' => 5), $minNumberValidator->getCriteria()); 113 129 } 114 130 115 131 /** 116 132 * assure that a pass thru validator is created correct 117 */ 118 public function testPassThruValidator() 133 * 134 * @test 135 */ 136 public function passThruValidator() 119 137 { 120 138 $passThruValidator = $this->xjconf->getConfigValue('passThru'); 121 $this->assert IsA($passThruValidator, 'stubPassThruValidator');139 $this->assertType('stubPassThruValidator', $passThruValidator); 122 140 } 123 141 124 142 /** 125 143 * assure that a min number validator is created correct 126 */ 127 public function testPreSelectValidator() 144 * 145 * @test 146 */ 147 public function preSelectValidator() 128 148 { 129 149 $preSelectValidator = $this->xjconf->getConfigValue('preSelect'); 130 $this->assert IsA($preSelectValidator, 'stubPreSelectValidator');131 $this->assertEqual ($preSelectValidator->getCriteria(), array('allowedValues' => array(313, 'Donald Duck', true)));150 $this->assertType('stubPreSelectValidator', $preSelectValidator); 151 $this->assertEquals(array('allowedValues' => array(313, 'Donald Duck', true)), $preSelectValidator->getCriteria()); 132 152 } 133 153 134 154 /** 135 155 * assure that a regex validator is created correct 136 */ 137 public function testRegexValidator() 156 * 157 * @test 158 */ 159 public function regexValidator() 138 160 { 139 161 $regexValidator = $this->xjconf->getConfigValue('regex'); 140 $this->assert IsA($regexValidator, 'stubRegexValidator');141 $this->assertEqual ($regexValidator->getCriteria(), array('regex' => '/([a-Z]){1,3}/'));162 $this->assertType('stubRegexValidator', $regexValidator); 163 $this->assertEquals(array('regex' => '/([a-Z]){1,3}/'), $regexValidator->getCriteria()); 142 164 } 143 165 144 166 /** 145 167 * assure that an and validator is created correct 146 */ 147 public function testAndValidator() 168 * 169 * @test 170 */ 171 public function andValidator() 148 172 { 149 173 $andValidator = $this->xjconf->getConfigValue('and'); 150 $this->assertIsA($andValidator, 'stubAndValidator'); 151 $this->assertEqual($andValidator->getCriteria(), array('expected' => 'This must be equal.', 152 'maxNumber' => 5.5 153 ) 174 $this->assertType('stubAndValidator', $andValidator); 175 $this->assertEquals(array('expected' => 'This must be equal.', 176 'maxNumber' => 5.5 177 ), 178 $andValidator->getCriteria() 154 179 ); 155 180 } … … 157 182 /** 158 183 * assure that an or validator is created correct 159 */ 160 public function testOrValidator() 184 * 185 * @test 186 */ 187 public function orValidator() 161 188 { 162 189 $orValidator = $this->xjconf->getConfigValue('or'); 163 $this->assertIsA($orValidator, 'stubOrValidator'); 164 $this->assertEqual($orValidator->getCriteria(), array('expected' => true, 165 'minNumber' => 5.5 166 ) 190 $this->assertType('stubOrValidator', $orValidator); 191 $this->assertEquals(array('expected' => true, 192 'minNumber' => 5.5 193 ), 194 $orValidator->getCriteria() 167 195 ); 168 196 } … … 170 198 /** 171 199 * assure that an xor validator is created correct 172 */ 173 public function testXorValidator() 200 * 201 * @test 202 */ 203 public function xorValidator() 174 204 { 175 205 $xorValidator = $this->xjconf->getConfigValue('xor'); 176 $this->assertIsA($xorValidator, 'stubXorValidator'); 177 $this->assertEqual($xorValidator->getCriteria(), array('expected' => 'null', 178 'regex' => '([a-Z]){1,3}' 179 ) 206 $this->assertType('stubXorValidator', $xorValidator); 207 $this->assertEquals(array('expected' => 'null', 208 'regex' => '([a-Z]){1,3}' 209 ), 210 $xorValidator->getCriteria() 180 211 ); 181 212 } trunk/src/test/php/net/stubbles/integration/stubRequestValueErrorXJConfFactoryTestCase.php
r1308 r1312 17 17 { 18 18 /** 19 * run all value error tests one after another 20 * 21 * @test 22 */ 23 public function all() 24 { 25 $rveFactory = new stubRequestValueErrorXJConfFactory(); 26 $this->FIELD_EMPTY($rveFactory); 27 $this->FIELD_NO_SELECT($rveFactory); 28 $this->FIELD_WRONG_VALUE($rveFactory); 29 $this->VALUE_TOO_SMALL($rveFactory); 30 $this->VALUE_TOO_GREAT($rveFactory); 31 $this->PASSWORDS_NOT_EQUAL($rveFactory); 32 $this->PASSWORD_INVALID($rveFactory); 33 $this->PASSWORD_TOO_LESS_DIFF_CHARS($rveFactory); 34 $this->STRING_TOO_SHORT($rveFactory); 35 $this->STRING_TOO_LONG($rveFactory); 36 $this->DATE_INVALID($rveFactory); 37 $this->DATE_TOO_EARLY($rveFactory); 38 $this->DATE_TOO_LATE($rveFactory); 39 $this->MAILADDRESS_INCORRECT($rveFactory); 40 $this->URL_INCORRECT($rveFactory); 41 $this->URL_NOT_AVAILABLE($rveFactory); 42 stubRequestValueErrorXJConfFactory::refresh(); 43 // cached 44 $rveFactory = new stubRequestValueErrorXJConfFactory(); 45 $this->FIELD_EMPTY($rveFactory); 46 $this->FIELD_NO_SELECT($rveFactory); 47 $this->FIELD_WRONG_VALUE($rveFactory); 48 $this->VALUE_TOO_SMALL($rveFactory); 49 $this->VALUE_TOO_GREAT($rveFactory); 50 $this->PASSWORDS_NOT_EQUAL($rveFactory); 51 $this->PASSWORD_INVALID($rveFactory); 52 $this->PASSWORD_TOO_LESS_DIFF_CHARS($rveFactory); 53 $this->STRING_TOO_SHORT($rveFactory); 54 $this->STRING_TOO_LONG($rveFactory); 55 $this->DATE_INVALID($rveFactory); 56 $this->DATE_TOO_EARLY($rveFactory); 57 $this->DATE_TOO_LATE($rveFactory); 58 $this->MAILADDRESS_INCORRECT($rveFactory); 59 $this->URL_INCORRECT($rveFactory); 60 $this->URL_NOT_AVAILABLE($rveFactory); 61 } 62 63 /** 19 64 * test that the FIELD_EMPTY error is created 20 65 */ 21 public function testFIELD_EMPTY() 22 { 23 $rveFactory = new stubRequestValueErrorXJConfFactory(); 66 public function FIELD_EMPTY($rveFactory) 67 { 24 68 $requestError = $rveFactory->create('FIELD_EMPTY'); 25 $this->assert IsA($requestError, 'stubRequestValueError');26 $this->assertEqual ($requestError->getId(), 'FIELD_EMPTY');69 $this->assertType('stubRequestValueError', $requestError); 70 $this->assertEquals('FIELD_EMPTY', $requestError->getId()); 27 71 $this->assertTrue($requestError->hasMessage('en_EN')); 28 72 $this->assertTrue($requestError->hasMessage('de_DE')); 29 73 $requestError2 = $rveFactory->create('FIELD_EMPTY'); 30 $this->assert Clone($requestError, $requestError2);74 $this->assertNotSame($requestError, $requestError2); 31 75 } 32 76 … … 34 78 * test that the FIELD_NO_SELECT error is created 35 79 */ 36 public function testFIELD_NO_SELECT() 37 { 38 $rveFactory = new stubRequestValueErrorXJConfFactory(); 80 public function FIELD_NO_SELECT($rveFactory) 81 { 39 82 $requestError = $rveFactory->create('FIELD_NO_SELECT'); 40 $this->assert IsA($requestError, 'stubRequestValueError');41 $this->assertEqual ($requestError->getId(), 'FIELD_NO_SELECT');83 $this->assertType('stubRequestValueError', $requestError); 84 $this->assertEquals('FIELD_NO_SELECT', $requestError->getId()); 42 85 $this->assertTrue($requestError->hasMessage('en_EN')); 43 86 $this->assertTrue($requestError->hasMessage('de_DE')); 44 87 $requestError2 = $rveFactory->create('FIELD_NO_SELECT'); 45 $this->assert Clone($requestError, $requestError2);88 $this->assertNotSame($requestError, $requestError2); 46 89 } 47 90 … … 49 92 * test that the FIELD_WRONG_VALUE error is created 50 93 */ 51 public function testFIELD_WRONG_VALUE() 52 { 53 $rveFactory = new stubRequestValueErrorXJConfFactory(); 94 public function FIELD_WRONG_VALUE($rveFactory) 95 { 54 96 $requestError = $rveFactory->create('FIELD_WRONG_VALUE'); 55 $this->assert IsA($requestError, 'stubRequestValueError');56 $this->assertEqual ($requestError->getId(), 'FIELD_WRONG_VALUE');97 $this->assertType('stubRequestValueError', $requestError); 98 $this->assertEquals('FIELD_WRONG_VALUE', $requestError->getId()); 57 99 $this->assertTrue($requestError->hasMessage('en_EN')); 58 100 $this->assertTrue($requestError->hasMessage('de_DE')); 59 101 $requestError2 = $rveFactory->create('FIELD_WRONG_VALUE'); 60 $this->assert Clone($requestError, $requestError2);102 $this->assertNotSame($requestError, $requestError2); 61 103 } 62 104 … … 64 106 * test that the VALUE_TOO_SMALL error is created 65 107 */ 66 public function testVALUE_TOO_SMALL() 67 { 68 $rveFactory = new stubRequestValueErrorXJConfFactory(); 108 public function VALUE_TOO_SMALL($rveFactory) 109 { 69 110 $requestError = $rveFactory->create('VALUE_TOO_SMALL'); 70 $this->assert IsA($requestError, 'stubRequestValueError');71 $this->assertEqual ($requestError->getId(), 'VALUE_TOO_SMALL');111 $this->assertType('stubRequestValueError', $requestError); 112 $this->assertEquals('VALUE_TOO_SMALL', $requestError->getId()); 72 113 $this->assertTrue($requestError->hasMessage('en_EN')); 73 114 $this->assertTrue($requestError->hasMessage('de_DE')); 74 115 $requestError2 = $rveFactory->create('VALUE_TOO_SMALL'); 75 $this->assert Clone($requestError, $requestError2);116 $this->assertNotSame($requestError, $requestError2); 76 117 } 77 118 … … 79 120 * test that the VALUE_TOO_GREAT error is created 80 121 */ 81 public function testVALUE_TOO_GREAT() 82 { 83 $rveFactory = new stubRequestValueErrorXJConfFactory(); 122 public function VALUE_TOO_GREAT($rveFactory) 123 { 84 124 $requestError = $rveFactory->create('VALUE_TOO_GREAT'); 85 $this->assert IsA($requestError, 'stubRequestValueError');86 $this->assertEqual ($requestError->getId(), 'VALUE_TOO_GREAT');125 $this->assertType('stubRequestValueError', $requestError); 126 $this->assertEquals('VALUE_TOO_GREAT', $requestError->getId()); 87 127 $this->assertTrue($requestError->hasMessage('en_EN')); 88 128 $this->assertTrue($requestError->hasMessage('de_DE')); 89 129 $requestError2 = $rveFactory->create('VALUE_TOO_GREAT'); 90 $this->assert Clone($requestError, $requestError2);130 $this->assertNotSame($requestError, $requestError2); 91 131 } 92 132 … … 94 134 * test that the PASSWORDS_NOT_EQUAL error is created 95 135 */ 96 public function testPASSWORDS_NOT_EQUAL() 97 { 98 $rveFactory = new stubRequestValueErrorXJConfFactory(); 136 public function PASSWORDS_NOT_EQUAL($rveFactory) 137 { 99 138 $requestError = $rveFactory->create('PASSWORDS_NOT_EQUAL'); 100 $this->assert IsA($requestError, 'stubRequestValueError');101 $this->assertEqual ($requestError->getId(), 'PASSWORDS_NOT_EQUAL');139 $this->assertType('stubRequestValueError', $requestError); 140 $this->assertEquals('PASSWORDS_NOT_EQUAL', $requestError->getId()); 102 141 $this->assertTrue($requestError->hasMessage('en_EN')); 103 142 $this->assertTrue($requestError->hasMessage('de_DE')); 104 143 $requestError2 = $rveFactory->create('PASSWORDS_NOT_EQUAL'); 105 $this->assert Clone($requestError, $requestError2);144 $this->assertNotSame($requestError, $requestError2); 106 145 } 107 146 … … 109 148 * test that the PASSWORD_INVALID error is created 110 149 */ 111 public function testPASSWORD_INVALID() 112 { 113 $rveFactory = new stubRequestValueErrorXJConfFactory(); 150 public function PASSWORD_INVALID($rveFactory) 151 { 114 152 $requestError = $rveFactory->create('PASSWORD_INVALID'); 115 $this->assert IsA($requestError, 'stubRequestValueError');116 $this->assertEqual ($requestError->getId(), 'PASSWORD_INVALID');153 $this->assertType('stubRequestValueError', $requestError); 154 $this->assertEquals('PASSWORD_INVALID', $requestError->getId()); 117 155 $this->assertTrue($requestError->hasMessage('en_EN')); 118 156 $this->assertTrue($requestError->hasMessage('de_DE')); 119 157 $requestError2 = $rveFactory->create('PASSWORD_INVALID'); 120 $this->assert Clone($requestError, $requestError2);158 $this->assertNotSame($requestError, $requestError2); 121 159 } 122 160 … … 124 162 * test that the PASSWORD_TOO_LESS_DIFF_CHARS error is created 125 163 */ 126 public function testPASSWORD_TOO_LESS_DIFF_CHARS() 127 { 128 $rveFactory = new stubRequestValueErrorXJConfFactory(); 164 public function PASSWORD_TOO_LESS_DIFF_CHARS($rveFactory) 165 { 129 166 $requestError = $rveFactory->create('PASSWORD_TOO_LESS_DIFF_CHARS'); 130 $this->assert IsA($requestError, 'stubRequestValueError');131 $this->assertEqual ($requestError->getId(), 'PASSWORD_TOO_LESS_DIFF_CHARS');167 $this->assertType('stubRequestValueError', $requestError); 168 $this->assertEquals('PASSWORD_TOO_LESS_DIFF_CHARS', $requestError->getId()); 132 169 $this->assertTrue($requestError->hasMessage('en_EN')); 133 170 $this->assertTrue($requestError->hasMessage('de_DE')); 134 171 $requestError2 = $rveFactory->create('PASSWORD_TOO_LESS_DIFF_CHARS'); 135 $this->assert Clone($requestError, $requestError2);172 $this->assertNotSame($requestError, $requestError2); 136 173 } 137 174 … … 139 176 * test that the STRING_TOO_SHORT error is created 140 177 */ 141 public function testSTRING_TOO_SHORT() 142 { 143 $rveFactory = new stubRequestValueErrorXJConfFactory(); 178 public function STRING_TOO_SHORT($rveFactory) 179 { 144 180 $requestError = $rveFactory->create('STRING_TOO_SHORT'); 145 $this->assert IsA($requestError, 'stubRequestValueError');146 $this->assertEqual ($requestError->getId(), 'STRING_TOO_SHORT');181 $this->assertType('stubRequestValueError', $requestError); 182 $this->assertEquals('STRING_TOO_SHORT', $requestError->getId()); 147 183 $this->assertTrue($requestError->hasMessage('en_EN')); 148 184 $this->assertTrue($requestError->hasMessage('de_DE')); 149 185 $requestError2 = $rveFactory->create('STRING_TOO_SHORT'); 150 $this->assert Clone($requestError, $requestError2);186 $this->assertNotSame($requestError, $requestError2); 151 187 } 152 188 … … 154 190 * test that the STRING_TOO_LONG error is created 155 191 */ 156 public function testSTRING_TOO_LONG() 157 { 158 $rveFactory = new stubRequestValueErrorXJConfFactory(); 192 public function STRING_TOO_LONG($rveFactory) 193 { 159 194 $requestError = $rveFactory->create('STRING_TOO_LONG'); 160 $this->assert IsA($requestError, 'stubRequestValueError');161 $this->assertEqual ($requestError->getId(), 'STRING_TOO_LONG');195 $this->assertType('stubRequestValueError', $requestError); 196 $this->assertEquals('STRING_TOO_LONG', $requestError->getId()); 162 197 $this->assertTrue($requestError->hasMessage('en_EN')); 163 198 $this->assertTrue($requestError->hasMessage('de_DE')); 164 199 $requestError2 = $rveFactory->create('STRING_TOO_LONG'); 165 $this->assert Clone($requestError, $requestError2);200 $this->assertNotSame($requestError, $requestError2); 166 201 } 167 202 … … 169 204 * test that the DATE_INVALID error is created 170 205 */ 171 public function testDATE_INVALID() 172 { 173 $rveFactory = new stubRequestValueErrorXJConfFactory(); 206 public function DATE_INVALID($rveFactory) 207 { 174 208 $requestError = $rveFactory->create('DATE_INVALID'); 175 $this->assert IsA($requestError, 'stubRequestValueError');176 $this->assertEqual ($requestError->getId(), 'DATE_INVALID');209 $this->assertType('stubRequestValueError', $requestError); 210 $this->assertEquals('DATE_INVALID', $requestError->getId()); 177 211 $this->assertTrue($requestError->hasMessage('en_EN')); 178 212 $this->assertTrue($requestError->hasMessage('de_DE')); 179 213 $requestError2 = $rveFactory->create('DATE_INVALID'); 180 $this->assert Clone($requestError, $requestError2);214 $this->assertNotSame($requestError, $requestError2); 181 215 } 182 216 … … 184 218 * test that the DATE_TOO_EARLY error is created 185 219 */ 186 public function testDATE_TOO_EARLY() 187 { 188 $rveFactory = new stubRequestValueErrorXJConfFactory(); 220 public function DATE_TOO_EARLY($rveFactory) 221 { 189 222 $requestError = $rveFactory->create('DATE_TOO_EARLY'); 190 $this->assert IsA($requestError, 'stubRequestValueError');191 $this->assertEqual ($requestError->getId(), 'DATE_TOO_EARLY');223 $this->assertType('stubRequestValueError', $requestError); 224 $this->assertEquals('DATE_TOO_EARLY', $requestError->getId()); 192 225 $this->assertTrue($requestError->hasMessage('en_EN')); 193 226 $this->assertTrue($requestError->hasMessage('de_DE')); 194 227 $requestError2 = $rveFactory->create('DATE_TOO_EARLY'); 195 $this->assert Clone($requestError, $requestError2);228 $this->assertNotSame($requestError, $requestError2); 196 229 } 197 230 … … 199 232 * test that the DATE_TOO_LATE error is created 200 233 */ 201 public function testDATE_TOO_LATE() 202 { 203 $rveFactory = new stubRequestValueErrorXJConfFactory(); 234 public function DATE_TOO_LATE($rveFactory) 235 { 204 236 $requestError = $rveFactory->create('DATE_TOO_LATE'); 205 $this->assert IsA($requestError, 'stubRequestValueError');206 $this->assertEqual ($requestError->getId(), 'DATE_TOO_LATE');237 $this->assertType('stubRequestValueError', $requestError); 238 $this->assertEquals('DATE_TOO_LATE', $requestError->getId()); 207 239 $this->assertTrue($requestError->hasMessage('en_EN')); 208 240 $this->assertTrue($requestError->hasMessage('de_DE')); 209 241 $requestError2 = $rveFactory->create('DATE_TOO_LATE'); 210 $this->assert Clone($requestError, $requestError2);242 $this->assertNotSame($requestError, $requestError2); 211 243 } 212 244 … … 214 246 * test that the MAILADDRESS_INCORRECT error is created 215 247 */ 216 public function testMAILADDRESS_INCORRECT() 217 { 218 $rveFactory = new stubRequestValueErrorXJConfFactory(); 248 public function MAILADDRESS_INCORRECT($rveFactory) 249 { 219 250 $requestError = $rveFactory->create('MAILADDRESS_INCORRECT'); 220 $this->assert IsA($requestError, 'stubRequestValueError');221 $this->assertEqual ($requestError->getId(), 'MAILADDRESS_INCORRECT');251 $this->assertType('stubRequestValueError', $requestError); 252 $this->assertEquals('MAILADDRESS_INCORRECT', $requestError->getId()); 222 253 $this->assertTrue($requestError->hasMessage('en_EN')); 223 254 $this->assertTrue($requestError->hasMessage('de_DE')); 224 255 $requestError2 = $rveFactory->create('MAILADDRESS_INCORRECT'); 225 $this->assert Clone($requestError, $requestError2);256 $this->assertNotSame($requestError, $requestError2); 226 257 } 227 258 … … 229 260 * test that the URL_INCORRECT error is created 230 261 */ 231 public function testURL_INCORRECT() 232 { 233 $rveFactory = new stubRequestValueErrorXJConfFactory(); 262 public function URL_INCORRECT($rveFactory) 263 { 234 264 $requestError = $rveFactory->create('URL_INCORRECT'); 235 $this->assert IsA($requestError, 'stubRequestValueError');236 $this->assertEqual ($requestError->getId(), 'URL_INCORRECT');265 $this->assertType('stubRequestValueError', $requestError); 266 $this->assertEquals('URL_INCORRECT', $requestError->getId()); 237 267 $this->assertTrue($requestError->hasMessage('en_EN')); 238 268 $this->assertTrue($requestError->hasMessage('de_DE')); 239 269 $requestError2 = $rveFactory->create('URL_INCORRECT'); 240 $this->assert Clone($requestError, $requestError2);270 $this->assertNotSame($requestError, $requestError2); 241 271 } 242 272 … … 244 274 * test that the URL_NOT_AVAILABLE error is created 245 275 */ 246 public function testURL_NOT_AVAILABLE() 247 { 248 $rveFactory = new stubRequestValueErrorXJConfFactory(); 276 public function URL_NOT_AVAILABLE($rveFactory) 277 { 249 278 $requestError = $rveFactory->create('URL_NOT_AVAILABLE'); 250 $this->assert IsA($requestError, 'stubRequestValueError');251 $this->assertEqual ($requestError->getId(), 'URL_NOT_AVAILABLE');279 $this->assertType('stubRequestValueError', $requestError); 280 $this->assertEquals('URL_NOT_AVAILABLE', $requestError->getId()); 252 281 $this->assertTrue($requestError->hasMessage('en_EN')); 253 282 $this->assertTrue($requestError->hasMessage('de_DE')); 254 283 $requestError2 = $rveFactory->create('URL_NOT_AVAILABLE'); 255 $this->assert Clone($requestError, $requestError2);284 $this->assertNotSame($requestError, $requestError2); 256 285 } 257 286 }
