Changeset 1312

Show
Ignore:
Timestamp:
01/31/08 00:39:27 (10 months ago)
Author:
mikey
Message:

continued refactoring #118: converted integration tests

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/ipo/request/stubRequestValueErrorXJConfFactory.php

    r1281 r1312  
    2626     */ 
    2727    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 
    2937    /** 
    3038     * constructor 
  • trunk/src/test/IntegrationTests.php

    r1308 r1312  
    1212} 
    1313 
    14 define('TEST_SRC_PATH', dirname(__FILE__)); 
     14if (defined('TEST_SRC_PATH') === false) { 
     15    define('TEST_SRC_PATH', dirname(__FILE__)); 
     16
     17 
    1518require_once TEST_SRC_PATH . '/../../config/php/config.php'; 
    1619require_once stubConfig::getSourcePath() . '/php/net/stubbles/stubClassLoader.php'; 
     
    5962        $suite->addTestFile($dir . '/RegistryTestCase.php'); 
    6063        $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'); 
    6366        $suite->addTestFile($dir . '/VariantManagerTestCase.php'); 
    6467        return $suite; 
  • trunk/src/test/php/net/stubbles/integration/ValidatorsXJConfTestCase.php

    r1220 r1312  
    1616 * @subpackage  test_integration 
    1717 */ 
    18 class ValidatorsXJConfTestCase extends UnitTestCase 
     18class ValidatorsXJConfTestCase extends PHPUnit_Framework_TestCase 
    1919{ 
    2020    /** 
     
    3737    /** 
    3838     * assure that a contains validator is created correct 
    39      */ 
    40     public function testContainsValidator() 
     39     * 
     40     * @test 
     41     */ 
     42    public function containsValidator() 
    4143    { 
    4244        $equalValidator = $this->xjconf->getConfigValue('contains'); 
    43         $this->assertIsA($equalValidator, 'stubContainsValidator'); 
    44         $this->assertEqual($equalValidator->getCriteria(), array('contained' => 'foo')); 
     45        $this->assertType('stubContainsValidator', $equalValidator); 
     46        $this->assertEquals(array('contained' => 'foo'), $equalValidator->getCriteria()); 
    4547    } 
    4648 
    4749    /** 
    4850     * assure that an equal validator is created correct 
    49      */ 
    50     public function testEqualValidator() 
     51     * 
     52     * @test 
     53     */ 
     54    public function equalValidator() 
    5155    { 
    5256        $equalValidator = $this->xjconf->getConfigValue('equal'); 
    53         $this->assertIsA($equalValidator, 'stubEqualValidator'); 
    54         $this->assertEqual($equalValidator->getCriteria(), array('expected' => 3)); 
     57        $this->assertType('stubEqualValidator', $equalValidator); 
     58        $this->assertEquals(array('expected' => 3), $equalValidator->getCriteria()); 
    5559    } 
    5660 
    5761    /** 
    5862     * assure that an ip validator is created correct 
    59      */ 
    60     public function testIPValidator() 
     63     * 
     64     * @test 
     65     */ 
     66    public function ipValidator() 
    6167    { 
    6268        $ipValidator = $this->xjconf->getConfigValue('ip'); 
    63         $this->assertIsA($ipValidator, 'stubIPValidator'); 
     69        $this->assertType('stubIPValidator', $ipValidator); 
    6470    } 
    6571 
    6672    /** 
    6773     * assure that a mail validator is created correct 
    68      */ 
    69     public function testMailValidator() 
     74     * 
     75     * @test 
     76     */ 
     77    public function mailValidator() 
    7078    { 
    7179        $mailValidator = $this->xjconf->getConfigValue('mail'); 
    72         $this->assertIsA($mailValidator, 'stubMailValidator'); 
     80        $this->assertType('stubMailValidator', $mailValidator); 
    7381    } 
    7482 
    7583    /** 
    7684     * assure that a max length validator is created correct 
    77      */ 
    78     public function testMaxLengthValidator() 
     85     * 
     86     * @test 
     87     */ 
     88    public function maxLengthValidator() 
    7989    { 
    8090        $maxLengthValidator = $this->xjconf->getConfigValue('maxLength'); 
    81         $this->assertIsA($maxLengthValidator, 'stubMaxLengthValidator'); 
    82         $this->assertEqual($maxLengthValidator->getCriteria(), array('maxLength' => 4)); 
     91        $this->assertType('stubMaxLengthValidator', $maxLengthValidator); 
     92        $this->assertEquals(array('maxLength' => 4), $maxLengthValidator->getCriteria()); 
    8393    } 
    8494 
    8595    /** 
    8696     * assure that a max number validator is created correct 
    87      */ 
    88     public function testMaxNumberValidator() 
     97     * 
     98     * @test 
     99     */ 
     100    public function maxNumberValidator() 
    89101    { 
    90102        $maxNumberValidator = $this->xjconf->getConfigValue('maxNumber'); 
    91         $this->assertIsA($maxNumberValidator, 'stubMaxNumberValidator'); 
    92         $this->assertEqual($maxNumberValidator->getCriteria(), array('maxNumber' => 5)); 
     103        $this->assertType('stubMaxNumberValidator', $maxNumberValidator); 
     104        $this->assertEquals(array('maxNumber' => 5), $maxNumberValidator->getCriteria()); 
    93105    } 
    94106 
    95107    /** 
    96108     * assure that a min length validator is created correct 
    97      */ 
    98     public function testMinLengthValidator() 
     109     * 
     110     * @test 
     111     */ 
     112    public function minLengthValidator() 
    99113    { 
    100114        $minLengthValidator = $this->xjconf->getConfigValue('minLength'); 
    101         $this->assertIsA($minLengthValidator, 'stubMinLengthValidator'); 
    102         $this->assertEqual($minLengthValidator->getCriteria(), array('minLength' => 4)); 
     115        $this->assertType('stubMinLengthValidator', $minLengthValidator); 
     116        $this->assertEquals(array('minLength' => 4), $minLengthValidator->getCriteria()); 
    103117    } 
    104118 
    105119    /** 
    106120     * assure that a min number validator is created correct 
    107      */ 
    108     public function testMinNumberValidator() 
     121     * 
     122     * @test 
     123     */ 
     124    public function minNumberValidator() 
    109125    { 
    110126        $minNumberValidator = $this->xjconf->getConfigValue('minNumber'); 
    111         $this->assertIsA($minNumberValidator, 'stubMinNumberValidator'); 
    112         $this->assertEqual($minNumberValidator->getCriteria(), array('minNumber' => 5)); 
     127        $this->assertType('stubMinNumberValidator', $minNumberValidator); 
     128        $this->assertEquals(array('minNumber' => 5), $minNumberValidator->getCriteria()); 
    113129    } 
    114130 
    115131    /** 
    116132     * assure that a pass thru validator is created correct 
    117      */ 
    118     public function testPassThruValidator() 
     133     * 
     134     * @test 
     135     */ 
     136    public function passThruValidator() 
    119137    { 
    120138        $passThruValidator = $this->xjconf->getConfigValue('passThru'); 
    121         $this->assertIsA($passThruValidator, 'stubPassThruValidator'); 
     139        $this->assertType('stubPassThruValidator', $passThruValidator); 
    122140    } 
    123141 
    124142    /** 
    125143     * assure that a min number validator is created correct 
    126      */ 
    127     public function testPreSelectValidator() 
     144     * 
     145     * @test 
     146     */ 
     147    public function preSelectValidator() 
    128148    { 
    129149        $preSelectValidator = $this->xjconf->getConfigValue('preSelect'); 
    130         $this->assertIsA($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()); 
    132152    } 
    133153 
    134154    /** 
    135155     * assure that a regex validator is created correct 
    136      */ 
    137     public function testRegexValidator() 
     156     * 
     157     * @test 
     158     */ 
     159    public function regexValidator() 
    138160    { 
    139161        $regexValidator = $this->xjconf->getConfigValue('regex'); 
    140         $this->assertIsA($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()); 
    142164    } 
    143165 
    144166    /** 
    145167     * assure that an and validator is created correct 
    146      */ 
    147     public function testAndValidator() 
     168     * 
     169     * @test 
     170     */ 
     171    public function andValidator() 
    148172    { 
    149173        $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() 
    154179        ); 
    155180    } 
     
    157182    /** 
    158183     * assure that an or validator is created correct 
    159      */ 
    160     public function testOrValidator() 
     184     * 
     185     * @test 
     186     */ 
     187    public function orValidator() 
    161188    { 
    162189        $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() 
    167195        ); 
    168196    } 
     
    170198    /** 
    171199     * assure that an xor validator is created correct 
    172      */ 
    173     public function testXorValidator() 
     200     * 
     201     * @test 
     202     */ 
     203    public function xorValidator() 
    174204    { 
    175205        $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() 
    180211        ); 
    181212    } 
  • trunk/src/test/php/net/stubbles/integration/stubRequestValueErrorXJConfFactoryTestCase.php

    r1308 r1312  
    1717{ 
    1818    /** 
     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    /** 
    1964     * test that the FIELD_EMPTY error is created 
    2065     */ 
    21     public function testFIELD_EMPTY() 
    22     { 
    23         $rveFactory = new stubRequestValueErrorXJConfFactory(); 
     66    public function FIELD_EMPTY($rveFactory) 
     67    { 
    2468        $requestError = $rveFactory->create('FIELD_EMPTY'); 
    25         $this->assertIsA($requestError, 'stubRequestValueError'); 
    26         $this->assertEqual($requestError->getId(), 'FIELD_EMPTY'); 
     69        $this->assertType('stubRequestValueError', $requestError); 
     70        $this->assertEquals('FIELD_EMPTY', $requestError->getId()); 
    2771        $this->assertTrue($requestError->hasMessage('en_EN')); 
    2872        $this->assertTrue($requestError->hasMessage('de_DE')); 
    2973        $requestError2 = $rveFactory->create('FIELD_EMPTY'); 
    30         $this->assertClone($requestError, $requestError2); 
     74        $this->assertNotSame($requestError, $requestError2); 
    3175    } 
    3276 
     
    3478     * test that the FIELD_NO_SELECT error is created 
    3579     */ 
    36     public function testFIELD_NO_SELECT() 
    37     { 
    38         $rveFactory = new stubRequestValueErrorXJConfFactory(); 
     80    public function FIELD_NO_SELECT($rveFactory) 
     81    { 
    3982        $requestError = $rveFactory->create('FIELD_NO_SELECT'); 
    40         $this->assertIsA($requestError, 'stubRequestValueError'); 
    41         $this->assertEqual($requestError->getId(), 'FIELD_NO_SELECT'); 
     83        $this->assertType('stubRequestValueError', $requestError); 
     84        $this->assertEquals('FIELD_NO_SELECT', $requestError->getId()); 
    4285        $this->assertTrue($requestError->hasMessage('en_EN')); 
    4386        $this->assertTrue($requestError->hasMessage('de_DE')); 
    4487        $requestError2 = $rveFactory->create('FIELD_NO_SELECT'); 
    45         $this->assertClone($requestError, $requestError2); 
     88        $this->assertNotSame($requestError, $requestError2); 
    4689    } 
    4790 
     
    4992     * test that the FIELD_WRONG_VALUE error is created 
    5093     */ 
    51     public function testFIELD_WRONG_VALUE() 
    52     { 
    53         $rveFactory = new stubRequestValueErrorXJConfFactory(); 
     94    public function FIELD_WRONG_VALUE($rveFactory) 
     95    { 
    5496        $requestError = $rveFactory->create('FIELD_WRONG_VALUE'); 
    55         $this->assertIsA($requestError, 'stubRequestValueError'); 
    56         $this->assertEqual($requestError->getId(), 'FIELD_WRONG_VALUE'); 
     97        $this->assertType('stubRequestValueError', $requestError); 
     98        $this->assertEquals('FIELD_WRONG_VALUE', $requestError->getId()); 
    5799        $this->assertTrue($requestError->hasMessage('en_EN')); 
    58100        $this->assertTrue($requestError->hasMessage('de_DE')); 
    59101        $requestError2 = $rveFactory->create('FIELD_WRONG_VALUE'); 
    60         $this->assertClone($requestError, $requestError2); 
     102        $this->assertNotSame($requestError, $requestError2); 
    61103    } 
    62104 
     
    64106     * test that the VALUE_TOO_SMALL error is created 
    65107     */ 
    66     public function testVALUE_TOO_SMALL() 
    67     { 
    68         $rveFactory = new stubRequestValueErrorXJConfFactory(); 
     108    public function VALUE_TOO_SMALL($rveFactory) 
     109    { 
    69110        $requestError = $rveFactory->create('VALUE_TOO_SMALL'); 
    70         $this->assertIsA($requestError, 'stubRequestValueError'); 
    71         $this->assertEqual($requestError->getId(), 'VALUE_TOO_SMALL'); 
     111        $this->assertType('stubRequestValueError', $requestError); 
     112        $this->assertEquals('VALUE_TOO_SMALL', $requestError->getId()); 
    72113        $this->assertTrue($requestError->hasMessage('en_EN')); 
    73114        $this->assertTrue($requestError->hasMessage('de_DE')); 
    74115        $requestError2 = $rveFactory->create('VALUE_TOO_SMALL'); 
    75         $this->assertClone($requestError, $requestError2); 
     116        $this->assertNotSame($requestError, $requestError2); 
    76117    } 
    77118 
     
    79120     * test that the VALUE_TOO_GREAT error is created 
    80121     */ 
    81     public function testVALUE_TOO_GREAT() 
    82     { 
    83         $rveFactory = new stubRequestValueErrorXJConfFactory(); 
     122    public function VALUE_TOO_GREAT($rveFactory) 
     123    { 
    84124        $requestError = $rveFactory->create('VALUE_TOO_GREAT'); 
    85         $this->assertIsA($requestError, 'stubRequestValueError'); 
    86         $this->assertEqual($requestError->getId(), 'VALUE_TOO_GREAT'); 
     125        $this->assertType('stubRequestValueError', $requestError); 
     126        $this->assertEquals('VALUE_TOO_GREAT', $requestError->getId()); 
    87127        $this->assertTrue($requestError->hasMessage('en_EN')); 
    88128        $this->assertTrue($requestError->hasMessage('de_DE')); 
    89129        $requestError2 = $rveFactory->create('VALUE_TOO_GREAT'); 
    90         $this->assertClone($requestError, $requestError2); 
     130        $this->assertNotSame($requestError, $requestError2); 
    91131    } 
    92132 
     
    94134     * test that the PASSWORDS_NOT_EQUAL error is created 
    95135     */ 
    96     public function testPASSWORDS_NOT_EQUAL() 
    97     { 
    98         $rveFactory = new stubRequestValueErrorXJConfFactory(); 
     136    public function PASSWORDS_NOT_EQUAL($rveFactory) 
     137    { 
    99138        $requestError = $rveFactory->create('PASSWORDS_NOT_EQUAL'); 
    100         $this->assertIsA($requestError, 'stubRequestValueError'); 
    101         $this->assertEqual($requestError->getId(), 'PASSWORDS_NOT_EQUAL'); 
     139        $this->assertType('stubRequestValueError', $requestError); 
     140        $this->assertEquals('PASSWORDS_NOT_EQUAL', $requestError->getId()); 
    102141        $this->assertTrue($requestError->hasMessage('en_EN')); 
    103142        $this->assertTrue($requestError->hasMessage('de_DE')); 
    104143        $requestError2 = $rveFactory->create('PASSWORDS_NOT_EQUAL'); 
    105         $this->assertClone($requestError, $requestError2); 
     144        $this->assertNotSame($requestError, $requestError2); 
    106145    } 
    107146 
     
    109148     * test that the PASSWORD_INVALID error is created 
    110149     */ 
    111     public function testPASSWORD_INVALID() 
    112     { 
    113         $rveFactory = new stubRequestValueErrorXJConfFactory(); 
     150    public function PASSWORD_INVALID($rveFactory) 
     151    { 
    114152        $requestError = $rveFactory->create('PASSWORD_INVALID'); 
    115         $this->assertIsA($requestError, 'stubRequestValueError'); 
    116         $this->assertEqual($requestError->getId(), 'PASSWORD_INVALID'); 
     153        $this->assertType('stubRequestValueError', $requestError); 
     154        $this->assertEquals('PASSWORD_INVALID', $requestError->getId()); 
    117155        $this->assertTrue($requestError->hasMessage('en_EN')); 
    118156        $this->assertTrue($requestError->hasMessage('de_DE')); 
    119157        $requestError2 = $rveFactory->create('PASSWORD_INVALID'); 
    120         $this->assertClone($requestError, $requestError2); 
     158        $this->assertNotSame($requestError, $requestError2); 
    121159    } 
    122160 
     
    124162     * test that the PASSWORD_TOO_LESS_DIFF_CHARS error is created 
    125163     */ 
    126     public function testPASSWORD_TOO_LESS_DIFF_CHARS() 
    127     { 
    128         $rveFactory = new stubRequestValueErrorXJConfFactory(); 
     164    public function PASSWORD_TOO_LESS_DIFF_CHARS($rveFactory) 
     165    { 
    129166        $requestError = $rveFactory->create('PASSWORD_TOO_LESS_DIFF_CHARS'); 
    130         $this->assertIsA($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()); 
    132169        $this->assertTrue($requestError->hasMessage('en_EN')); 
    133170        $this->assertTrue($requestError->hasMessage('de_DE')); 
    134171        $requestError2 = $rveFactory->create('PASSWORD_TOO_LESS_DIFF_CHARS'); 
    135         $this->assertClone($requestError, $requestError2); 
     172        $this->assertNotSame($requestError, $requestError2); 
    136173    } 
    137174 
     
    139176     * test that the STRING_TOO_SHORT error is created 
    140177     */ 
    141     public function testSTRING_TOO_SHORT() 
    142     { 
    143         $rveFactory = new stubRequestValueErrorXJConfFactory(); 
     178    public function STRING_TOO_SHORT($rveFactory) 
     179    { 
    144180        $requestError = $rveFactory->create('STRING_TOO_SHORT'); 
    145         $this->assertIsA($requestError, 'stubRequestValueError'); 
    146         $this->assertEqual($requestError->getId(), 'STRING_TOO_SHORT'); 
     181        $this->assertType('stubRequestValueError', $requestError); 
     182        $this->assertEquals('STRING_TOO_SHORT', $requestError->getId()); 
    147183        $this->assertTrue($requestError->hasMessage('en_EN')); 
    148184        $this->assertTrue($requestError->hasMessage('de_DE')); 
    149185        $requestError2 = $rveFactory->create('STRING_TOO_SHORT'); 
    150         $this->assertClone($requestError, $requestError2); 
     186        $this->assertNotSame($requestError, $requestError2); 
    151187    } 
    152188 
     
    154190     * test that the STRING_TOO_LONG error is created 
    155191     */ 
    156     public function testSTRING_TOO_LONG() 
    157     { 
    158         $rveFactory = new stubRequestValueErrorXJConfFactory(); 
     192    public function STRING_TOO_LONG($rveFactory) 
     193    { 
    159194        $requestError = $rveFactory->create('STRING_TOO_LONG'); 
    160         $this->assertIsA($requestError, 'stubRequestValueError'); 
    161         $this->assertEqual($requestError->getId(), 'STRING_TOO_LONG'); 
     195        $this->assertType('stubRequestValueError', $requestError); 
     196        $this->assertEquals('STRING_TOO_LONG', $requestError->getId()); 
    162197        $this->assertTrue($requestError->hasMessage('en_EN')); 
    163198        $this->assertTrue($requestError->hasMessage('de_DE')); 
    164199        $requestError2 = $rveFactory->create('STRING_TOO_LONG'); 
    165         $this->assertClone($requestError, $requestError2); 
     200        $this->assertNotSame($requestError, $requestError2); 
    166201    } 
    167202 
     
    169204     * test that the DATE_INVALID error is created 
    170205     */ 
    171     public function testDATE_INVALID() 
    172     { 
    173         $rveFactory = new stubRequestValueErrorXJConfFactory(); 
     206    public function DATE_INVALID($rveFactory) 
     207    { 
    174208        $requestError = $rveFactory->create('DATE_INVALID'); 
    175         $this->assertIsA($requestError, 'stubRequestValueError'); 
    176         $this->assertEqual($requestError->getId(), 'DATE_INVALID'); 
     209        $this->assertType('stubRequestValueError', $requestError); 
     210        $this->assertEquals('DATE_INVALID', $requestError->getId()); 
    177211        $this->assertTrue($requestError->hasMessage('en_EN')); 
    178212        $this->assertTrue($requestError->hasMessage('de_DE')); 
    179213        $requestError2 = $rveFactory->create('DATE_INVALID'); 
    180         $this->assertClone($requestError, $requestError2); 
     214        $this->assertNotSame($requestError, $requestError2); 
    181215    } 
    182216 
     
    184218     * test that the DATE_TOO_EARLY error is created 
    185219     */ 
    186     public function testDATE_TOO_EARLY() 
    187     { 
    188         $rveFactory = new stubRequestValueErrorXJConfFactory(); 
     220    public function DATE_TOO_EARLY($rveFactory) 
     221    { 
    189222        $requestError = $rveFactory->create('DATE_TOO_EARLY'); 
    190         $this->assertIsA($requestError, 'stubRequestValueError'); 
    191         $this->assertEqual($requestError->getId(), 'DATE_TOO_EARLY'); 
     223        $this->assertType('stubRequestValueError', $requestError); 
     224        $this->assertEquals('DATE_TOO_EARLY', $requestError->getId()); 
    192225        $this->assertTrue($requestError->hasMessage('en_EN')); 
    193226        $this->assertTrue($requestError->hasMessage('de_DE')); 
    194227        $requestError2 = $rveFactory->create('DATE_TOO_EARLY'); 
    195         $this->assertClone($requestError, $requestError2); 
     228        $this->assertNotSame($requestError, $requestError2); 
    196229    } 
    197230 
     
    199232     * test that the DATE_TOO_LATE error is created 
    200233     */ 
    201     public function testDATE_TOO_LATE() 
    202     { 
    203         $rveFactory = new stubRequestValueErrorXJConfFactory(); 
     234    public function DATE_TOO_LATE($rveFactory) 
     235    { 
    204236        $requestError = $rveFactory->create('DATE_TOO_LATE'); 
    205         $this->assertIsA($requestError, 'stubRequestValueError'); 
    206         $this->assertEqual($requestError->getId(), 'DATE_TOO_LATE'); 
     237        $this->assertType('stubRequestValueError', $requestError); 
     238        $this->assertEquals('DATE_TOO_LATE', $requestError->getId()); 
    207239        $this->assertTrue($requestError->hasMessage('en_EN')); 
    208240        $this->assertTrue($requestError->hasMessage('de_DE')); 
    209241        $requestError2 = $rveFactory->create('DATE_TOO_LATE'); 
    210         $this->assertClone($requestError, $requestError2); 
     242        $this->assertNotSame($requestError, $requestError2); 
    211243    } 
    212244 
     
    214246     * test that the MAILADDRESS_INCORRECT error is created 
    215247     */ 
    216     public function testMAILADDRESS_INCORRECT() 
    217     { 
    218         $rveFactory = new stubRequestValueErrorXJConfFactory(); 
     248    public function MAILADDRESS_INCORRECT($rveFactory) 
     249    { 
    219250        $requestError = $rveFactory->create('MAILADDRESS_INCORRECT'); 
    220         $this->assertIsA($requestError, 'stubRequestValueError'); 
    221         $this->assertEqual($requestError->getId(), 'MAILADDRESS_INCORRECT'); 
     251        $this->assertType('stubRequestValueError', $requestError); 
     252        $this->assertEquals('MAILADDRESS_INCORRECT', $requestError->getId()); 
    222253        $this->assertTrue($requestError->hasMessage('en_EN')); 
    223254        $this->assertTrue($requestError->hasMessage('de_DE')); 
    224255        $requestError2 = $rveFactory->create('MAILADDRESS_INCORRECT'); 
    225         $this->assertClone($requestError, $requestError2); 
     256        $this->assertNotSame($requestError, $requestError2); 
    226257    } 
    227258 
     
    229260     * test that the URL_INCORRECT error is created 
    230261     */ 
    231     public function testURL_INCORRECT() 
    232     { 
    233         $rveFactory = new stubRequestValueErrorXJConfFactory(); 
     262    public function URL_INCORRECT($rveFactory) 
     263    { 
    234264        $requestError = $rveFactory->create('URL_INCORRECT'); 
    235         $this->assertIsA($requestError, 'stubRequestValueError'); 
    236         $this->assertEqual($requestError->getId(), 'URL_INCORRECT'); 
     265        $this->assertType('stubRequestValueError', $requestError); 
     266        $this->assertEquals('URL_INCORRECT', $requestError->getId()); 
    237267        $this->assertTrue($requestError->hasMessage('en_EN')); 
    238268        $this->assertTrue($requestError->hasMessage('de_DE')); 
    239269        $requestError2 = $rveFactory->create('URL_INCORRECT'); 
    240         $this->assertClone($requestError, $requestError2); 
     270        $this->assertNotSame($requestError, $requestError2); 
    241271    } 
    242272 
     
    244274     * test that the URL_NOT_AVAILABLE error is created 
    245275     */ 
    246     public function testURL_NOT_AVAILABLE() 
    247     { 
    248         $rveFactory = new stubRequestValueErrorXJConfFactory(); 
     276    public function URL_NOT_AVAILABLE($rveFactory) 
     277    { 
    249278        $requestError = $rveFactory->create('URL_NOT_AVAILABLE'); 
    250         $this->assertIsA($requestError, 'stubRequestValueError'); 
    251         $this->assertEqual($requestError->getId(), 'URL_NOT_AVAILABLE'); 
     279        $this->assertType('stubRequestValueError', $requestError); 
     280        $this->assertEquals('URL_NOT_AVAILABLE', $requestError->getId()); 
    252281        $this->assertTrue($requestError->hasMessage('en_EN')); 
    253282        $this->assertTrue($requestError->hasMessage('de_DE')); 
    254283        $requestError2 = $rveFactory->create('URL_NOT_AVAILABLE'); 
    255         $this->assertClone($requestError, $requestError2); 
     284        $this->assertNotSame($requestError, $requestError2); 
    256285    } 
    257286}