Changeset 140

Show
Ignore:
Timestamp:
01/23/07 16:51:25 (2 years ago)
Author:
mikey
Message:

added more documentation
changed stubValidator::getCriterias() to correct name stubValidator::getCriteria()
set correct return value for Binford::getCriteria()

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/helper/Binford.php

    r97 r140  
    4949     
    5050    /** 
    51      * returns a list of criterias for the validator 
     51     * returns a list of criteria for the validator 
    5252     * 
    53      * @return  array<string,mixed>  key is criteria name, value is criteria value 
     53     * <code> 
     54     * array('allowedValues' => array(6100, 'Binford', 'Binford 6100'); 
     55     * </code> 
     56     *  
     57     * @return  array<string,mixed>  key is criterion name, value is criterion value 
    5458     */ 
    55     public function getCriterias() 
     59    public function getCriteria() 
    5660    { 
    57         return array(); 
     61        return array('allowedValues' => array(self::POWER, 'Binford', 'Binford ' . self::POWER)); 
    5862    } 
    5963     
  • trunk/src/main/php/net/stubbles/helper/validators/stubAbstractCompositeValidator.php

    r97 r140  
    1010/** 
    1111 * Base class for composite validators. 
     12 *  
     13 * A composite validator can be used to combine two or more validators 
     14 * into a single validator which then applies all those validators for the 
     15 * value to validate. 
    1216 * 
    1317 * @package     stubbles 
     
    1721{ 
    1822    /** 
    19      * list of validators to connect 
     23     * list of validators to combine 
    2024     * 
    2125     * @var  array<stubValidator> 
     
    4650        } 
    4751         
    48         return $this->validateReal($value); 
     52        return $this->doValidate($value); 
    4953    } 
    5054     
     
    5559     * @return  bool   true if value is ok, else false 
    5660     */ 
    57     protected abstract function validateReal($value); 
     61    protected abstract function doValidate($value); 
    5862     
    5963    /** 
    60      * returns a list of criterias for the validator 
     64     * returns a list of criteria for the validator 
    6165     * 
    62      * @return  array<string,mixed>  key is criteria name, value is criteria value 
     66     * @return  array<string,mixed>  key is criterion name, value is criterion value 
    6367     */ 
    64     public function getCriterias() 
     68    public function getCriteria() 
    6569    { 
    6670        $criterias = array(); 
    6771        foreach ($this->validators as $validator) { 
    68             $criterias = array_merge($criterias, $validator->getCriterias()); 
     72            $criterias = array_merge($criterias, $validator->getCriteria()); 
    6973        } 
    7074         
  • trunk/src/main/php/net/stubbles/helper/validators/stubAndValidator.php

    r97 r140  
    11<?php 
    22/** 
    3  * Class that connects differant validators that all have to be true in order  
     3 * Class that combines differant validators that all have to be true in order  
    44 * that this validator also reports true. 
    55 *  
     
    1010stubClassLoader::load('net.stubbles.helper.validators.stubAbstractCompositeValidator'); 
    1111/** 
    12  * Class that connects differant validators that all have to be true in order  
     12 * Class that combines differant validators that all have to be true in order  
    1313 * that this validator also reports true. 
     14 *  
     15 * If any of the combined validators returns false the stubAndValidator 
     16 * will return false as well. 
    1417 * 
    1518 * @package     stubbles 
     
    2023    /** 
    2124     * validate the given value 
     25     *  
     26     * If any of the validators returns false this will return false as well. 
    2227     * 
    2328     * @param   mixed  $value 
    2429     * @return  bool   true if value is ok, else false 
    2530     */ 
    26     protected function validateReal($value) 
     31    protected function doValidate($value) 
    2732    { 
    2833        foreach ($this->validators as $validator) { 
  • trunk/src/main/php/net/stubbles/helper/validators/stubCompositeValidator.php

    r97 r140  
    11<?php 
    22/** 
    3  * Base class for composite validators. 
     3 * Interface for composite validators. 
    44 *  
    55 * @author      Frank Kleine <mikey@stubbles.net> 
     
    99stubClassLoader::load('net.stubbles.helper.validators.stubValidator'); 
    1010/** 
    11  * Base class for composite validators. 
     11 * Interface for composite validators. 
     12 *  
     13 * Composite validators can be used to combine two or more validators 
     14 * into a single validator. 
    1215 * 
    1316 * @package     stubbles 
  • trunk/src/main/php/net/stubbles/helper/validators/stubEqualValidator.php

    r97 r140  
    1010/** 
    1111 * Class for validating that something is equal. 
     12 *  
     13 * This class can compare any scalar value with an expected value. The  
     14 * value to validate has to be of the same type and should have the same 
     15 * content as the expected value. 
    1216 * 
    1317 * @package     stubbles 
     
    2630     * constructor 
    2731     *  
    28      * @param   mixed  $expected 
    29      * @throws  ValidatorException 
     32     * @param   scalar|null  $expected 
     33     * @throws  stubValidatorException 
    3034     */ 
    3135    public function __construct($expected) 
     
    3943 
    4044    /** 
    41      * validate the given value 
     45     * validate that the given value is eqal in content and type to the expected value 
    4246     * 
    43      * @param   mixed  $value 
    44      * @return  bool   true if value is equal to expected value, else false 
    45      * @throws  ValidatorException 
     47     * @param   scalar|null  $value 
     48     * @return  bool         true if value is equal to expected value, else false 
     49     * @throws  stubValidatorException 
    4650     */ 
    4751    public function validate($value) 
     
    5963     
    6064    /** 
    61      * returns a list of criterias for the validator 
     65     * returns a list of criteria for the validator 
     66     *  
     67     * <code> 
     68     * array('expected' => [expected_value]); 
     69     * </code> 
    6270     * 
    63      * @return  array<string, mixed>  key is criteria name, value is criteria value 
     71     * @return  array<string,mixed>  key is criterion name, value is criterion value 
    6472     */ 
    65     public function getCriterias() 
     73    public function getCriteria() 
    6674    { 
    6775        return array('expected' => $this->expected); 
  • trunk/src/main/php/net/stubbles/helper/validators/stubMaxLengthValidator.php

    r97 r140  
    11<?php 
    22/** 
    3  * Validator to ensure a value is not longer than a given maximum length. 
     3 * Validator to ensure that a string is not longer than a given maximum length. 
    44 *  
    55 * @author      Frank Kleine <mikey@stubbles.net> 
     
    99stubClassLoader::load('net.stubbles.helper.validators.stubValidator'); 
    1010/** 
    11  * Validator to ensure a value is not longer than a given maximum length. 
     11 * Validator to ensure that a string is not longer than a given maximum length. 
    1212 * 
    1313 * @package     stubbles 
     
    3434     
    3535    /** 
    36      * validate the given value 
     36     * validate that the given value is not longer than the maximum length 
    3737     * 
    38      * @param   mixed  $value 
    39      * @return  bool   true if value is not longer than maximal length, else false 
     38     * @param   string  $value 
     39     * @return  bool    true if value is not longer than maximal length, else false 
    4040     */ 
    4141    public function validate($value) 
     
    4949     
    5050    /** 
    51      * returns a list of criterias for the validator 
     51     * returns a list of criteria for the validator 
     52     *  
     53     * <code> 
     54     * array('maxLength' => [max_length_of_string]); 
     55     * </code> 
    5256     * 
    53      * @return  array<string, mixed>  key is criteria name, value is criteria value 
     57     * @return  array<string,mixed>  key is criterion name, value is criterion value 
    5458     */ 
    55     public function getCriterias() 
     59    public function getCriteria() 
    5660    { 
    5761        return array('maxLength' => $this->maxLength); 
  • trunk/src/main/php/net/stubbles/helper/validators/stubMaxNumberValidator.php

    r97 r140  
    11<?php 
    22/** 
    3  * Validator to ensure a value is not greater than a given maximum value. 
     3 * Validator to ensure that a value is not greater than a given maximum value. 
    44 *  
    55 * @author      Frank Kleine <mikey@stubbles.net> 
     
    99stubClassLoader::load('net.stubbles.helper.validators.stubValidator'); 
    1010/** 
    11  * Validator to ensure a value is not greater than a given maximum value. 
     11 * Validator to ensure that a value is not greater than a given maximum value. 
    1212 * 
    1313 * @package     stubbles 
     
    2121     * @var  string 
    2222     */ 
    23     protected $max
     23    protected $maxValue
    2424     
    2525    /** 
    2626     * constructor 
    2727     * 
    28      * @param  int|double  $max  maximum value 
     28     * @param  int|double  $maxValue  maximum value 
    2929     */ 
    30     public function __construct($max
     30    public function __construct($maxValue
    3131    { 
    32         $this->max = $max
     32        $this->maxValue = $maxValue
    3333    } 
    3434     
    3535    /** 
    36      * validate the given value 
     36     * validate that the given value is smaller than or equal to the maximum value 
    3737     * 
    38      * @param   mixed  $value 
    39      * @return  bool   true if value is not greater than maximum value, else false 
     38     * @param   int|double  $value 
     39     * @return  bool        true if value is smaller than or equal to maximum value, else false 
    4040     */ 
    4141    public function validate($value) 
    4242    { 
    43         if ($value > $this->max) { 
     43        if ($value > $this->maxValue) { 
    4444            return false; 
    4545        } 
     
    4949     
    5050    /** 
    51      * returns a list of criterias for the validator 
     51     * returns a list of criteria for the validator 
     52     *  
     53     * <code> 
     54     * array('maxNumber' => [maximum_value]); 
     55     * </code> 
    5256     * 
    53      * @return  array<string, mixed>  key is criteria name, value is criteria value 
     57     * @return  array<string,mixed>  key is criterion name, value is criterion value 
    5458     */ 
    55     public function getCriterias() 
     59    public function getCriteria() 
    5660    { 
    57         return array('maxNumber' => $this->max); 
     61        return array('maxNumber' => $this->maxValue); 
    5862    } 
    5963} 
  • trunk/src/main/php/net/stubbles/helper/validators/stubMinLengthValidator.php

    r97 r140  
    11<?php 
    22/** 
    3  * Validator to ensure a value is not shorter than a given minimum length. 
     3 * Validator to ensure that a string is not shorter than a given minimum length. 
    44 *  
    55 * @author      Frank Kleine <mikey@stubbles.net> 
     
    99stubClassLoader::load('net.stubbles.helper.validators.stubValidator'); 
    1010/** 
    11  * Validator to ensure a value is not shorter than a given minimum length. 
     11 * Validator to ensure that a string is not shorter than a given minimum length. 
    1212 * 
    1313 * @package     stubbles 
     
    3434     
    3535    /** 
    36      * validate the given value 
     36     * validate that the given value is not shorter than the maximum length 
    3737     * 
    38      * @param   mixed  $value 
    39      * @return  bool   true if value is not shorter than minimum length, else false 
     38     * @param   string  $value 
     39     * @return  bool    true if value is not shorter than minimum length, else false 
    4040     */ 
    4141    public function validate($value) 
     
    4949     
    5050    /** 
    51      * returns a list of criterias for the validator 
     51     * returns a list of criteria for the validator 
    5252     * 
    53      * @return  array<string, mixed>  key is criteria name, value is criteria value 
     53     * <code> 
     54     * array('minLength' => [min_length_of_string]); 
     55     * </code> 
     56     * 
     57     * @return  array<string,mixed>  key is criterion name, value is criterion value 
    5458     */ 
    55     public function getCriterias() 
     59    public function getCriteria() 
    5660    { 
    5761        return array('minLength' => $this->minLength); 
  • trunk/src/main/php/net/stubbles/helper/validators/stubMinNumberValidator.php

    r97 r140  
    11<?php 
    22/** 
    3  * Validator to ensure a value is not smaller than a given minimum value. 
     3 * Validator to ensure that a value is not smaller than a given minimum value. 
    44 *  
    55 * @author      Frank Kleine <mikey@stubbles.net> 
     
    99stubClassLoader::load('net.stubbles.helper.validators.stubValidator'); 
    1010/** 
    11  * Validator to ensure a value is not smaller than a given minimum value. 
     11 * Validator to ensure that a value is not smaller than a given minimum value. 
    1212 * 
    1313 * @package     stubbles 
     
    2121     * @var  string 
    2222     */ 
    23     protected $min
     23    protected $minValue
    2424     
    2525    /** 
     
    2828     * @param  int|double  $min  minimum value 
    2929     */ 
    30     public function __construct($min
     30    public function __construct($minValue
    3131    { 
    32         $this->min = $min
     32        $this->minValue = $minValue
    3333    } 
    3434     
    3535    /** 
    36      * validate the given value 
     36     * validate that the given value is greater than or equal to the maximum value 
    3737     * 
    38      * @param   mixed  $value 
    39      * @return  bool   true if value is not smaller than minimum value, else false 
     38     * @param   int|double  $value 
     39     * @return  bool        true if value is greater than or equal to minimum value, else false 
    4040     */ 
    4141    public function validate($value) 
    4242    { 
    43         if ($value < $this->min) { 
     43        if ($value < $this->minValue) { 
    4444            return false; 
    4545        } 
     
    4949     
    5050    /** 
    51      * returns a list of criterias for the validator 
     51     * returns a list of criteria for the validator 
    5252     * 
    53      * @return  array<string, mixed>  key is criteria name, value is criteria value 
     53     * <code> 
     54     * array('minNumber' => [minimum_value]); 
     55     * </code> 
     56     * 
     57     * @return  array<string,mixed>  key is criterion name, value is criterion value 
    5458     */ 
    55     public function getCriterias() 
     59    public function getCriteria() 
    5660    { 
    57         return array('minNumber' => $this->min); 
     61        return array('minNumber' => $this->minValue); 
    5862    } 
    5963} 
  • trunk/src/main/php/net/stubbles/helper/validators/stubOrValidator.php

    r97 r140  
    11<?php 
    22/** 
    3  * Class that connects differant validators where one has to be true. 
     3 * Class that combines differant validators where one has to be true. 
    44 *  
    55 * @author      Frank Kleine <mikey@stubbles.net> 
     
    99stubClassLoader::load('net.stubbles.helper.validators.stubAbstractCompositeValidator'); 
    1010/** 
    11  * Class that connects differant validators where one has to be true. 
     11 * Class that combines differant validators where one has to be true. 
     12 *  
     13 * If any of the combined validators returns true the stubOrValidator 
     14 * will return true as well. 
    1215 * 
    1316 * @package     stubbles 
     
    1821    /** 
    1922     * validate the given value 
     23     *  
     24     * If any of the validators returns true this will return true as well. 
    2025     * 
    2126     * @param   mixed  $value 
    2227     * @return  bool   true if value is ok, else false 
    2328     */ 
    24     protected function validateReal($value) 
     29    protected function doValidate($value) 
    2530    { 
    2631        foreach ($this->validators as $validator) { 
  • trunk/src/main/php/net/stubbles/helper/validators/stubPreSelectValidator.php

    r97 r140  
    3434     
    3535    /** 
    36      * validate the given value 
     36     * validate that the given value is within a list of allowed values 
    3737     * 
    3838     * @param   mixed  $value 
    3939     * @return  bool   true if value is in list of allowed values, else false 
     40     * @todo    fix arrays: if $value is an array consisting of several values 
     41     *          each value has to be checked seperately if it is an allowed one 
    4042     */ 
    4143    public function validate($value) 
     
    4547     
    4648    /** 
    47      * returns a list of criterias for the validator 
     49     * returns a list of criteria for the validator 
    4850     * 
    49      * @return  array<string, mixed>  key is criteria name, value is criteria value 
     51     * <code> 
     52     * array('allowedValues' => [array_of_allowed_values]); 
     53     * </code> 
     54     * 
     55     * @return  array<string,array>  key is criterion name, value is criterion value 
    5056     */ 
    51     public function getCriterias() 
     57    public function getCriteria() 
    5258    { 
    5359        return array('allowedValues' => $this->allowedValues); 
  • trunk/src/main/php/net/stubbles/helper/validators/stubRegexValidator.php

    r97 r140  
    1010/** 
    1111 * Validator to ensure a value complies to a given regular expression. 
     12 *  
     13 * The validator uses preg_match() and checks if the value occurs exactly 
     14 * one time. Please note that a delimiter is automatically applied. The used 
     15 * delimiter is /, therefore it must be escaped if this character is part of 
     16 * the regular expression.  
    1217 * 
    1318 * @package     stubbles 
     
    2530    /** 
    2631     * constructor 
     32     *  
     33     * Please note that a delimiter is automatically applied. The used 
     34     * delimiter is /, therefore it must be escaped if this character  
     35     * is part of the regular expression. 
    2736     * 
    2837     * @param  string  $regex  regular expression to use for validation 
     
    3443     
    3544    /** 
    36      * validate the given value 
    37      * 
     45     * validate that the given value complies with the regular expression 
     46     *  
    3847     * @param   mixed  $value 
    39      * @return  bool   true if value is ok, else false 
     48     * @return  bool   true if value complies with regular expression, else false 
    4049     */ 
    4150    public function validate($value) 
    4251    { 
    43         // check if regular expression is fulfilled which means that at 
    44         // least one occurrence must be found 
    4552        if (preg_match('/' . $this->regex . '/', $value) != 1) { 
    4653            return false; 
     
    5158     
    5259    /** 
    53      * returns a list of criterias for the validator 
     60     * returns a list of criteria for the validator 
    5461     * 
    55      * @return  array<string, mixed>  key is criteria name, value is criteria value 
     62     * <code> 
     63     * array('regex' => [regular_expression]); 
     64     * </code> 
     65     * 
     66     * @return  array<string,mixed>  key is criterion name, value is criterion value 
    5667     */ 
    57     public function getCriterias() 
     68    public function getCriteria() 
    5869    { 
    5970        return array('regex' => $this->regex); 
  • trunk/src/main/php/net/stubbles/helper/validators/stubValidator.php

    r97 r140  
    1010/** 
    1111 * Interface for validators. 
     12 *  
     13 * Validators allow simple checks whether a value fulfils a set of criteria. 
    1214 * 
    1315 * @package     stubbles 
     
    1820    /** 
    1921     * validate the given value 
     22     *  
     23     * Returns true if the value does fulfils all of the criteria, else false. 
    2024     * 
    2125     * @param   mixed  $value 
     
    2630     
    2731    /** 
    28      * returns a list of criterias for the validator 
     32     * returns a list of criteria for the validator 
    2933     * 
    30      * @return  array<string,mixed>  key is criteria name, value is criteria value 
     34     * @return  array<string,mixed>  key is criterion name, value is criterion value 
    3135     */ 
    32     public function getCriterias(); 
     36    public function getCriteria(); 
    3337} 
    3438?> 
  • trunk/src/main/php/net/stubbles/helper/validators/stubXorValidator.php

    r97 r140  
    11<?php 
    22/** 
    3  * Class that connects differant validators where one has to be true. 
     3 * Class that combines differant validators where one has to be true. 
    44 *  
    55 * @author      Frank Kleine <mikey@stubbles.net> 
     
    99stubClassLoader::load('net.stubbles.helper.validators.stubAbstractCompositeValidator'); 
    1010/** 
    11  * Class that connects differant validators where one has to be true. 
     11 * Class that combines differant validators where one has to be true. 
     12 *  
     13 * If no validator or more than one validator returns false the stubXorValidator 
     14 * will return false as well. It only returns true if one validator returns true 
     15 * and any other validator returns false. 
    1216 * 
    1317 * @package     stubbles 
     
    1822    /** 
    1923     * validate the given value 
     24     *  
     25     * If no validator or more than one validator returns false it 
     26     * will return false as well. It only returns true if one 
     27     * validator returns true and any other validator returns false. 
    2028     * 
    2129     * @param   mixed  $value 
    2230     * @return  bool   true if value is ok, else false 
    2331     */ 
    24     protected function validateReal($value) 
     32    protected function doValidate($value) 
    2533    { 
    2634        $trueCount = 0; 
    2735        foreach ($this->validators as $validator) { 
    28             if ($validator->validate($value) == true) { 
    29                 $trueCount++; 
    30                 if (1 < $trueCount) { 
    31                     return false; 
    32                 } 
     36            if ($validator->validate($value) == false) { 
     37                continue; 
     38            } 
     39             
     40            $trueCount++; 
     41            if (1 < $trueCount) { 
     42                // more than one true received, 
     43                // can not return with true any more 
     44                return false; 
    3345            } 
    3446        } 
    3547         
    36         if (0 == $trueCount) { 
    37             return false; 
    38         } 
    39          
    40         return true; 
     48        return (1 == $trueCount); 
    4149    } 
    4250} 
  • trunk/src/main/php/net/stubbles/ipo/request/filters/stubAbstractStringFilter.php

    r97 r140  
    6565        // if input is shorter than maximal allowed length 
    6666        } elseif (null != $this->minLength && $this->minLength->validate($value) == false) { 
    67             throw new stubFilterException($this->rveFactory->create('STRING_TOO_SHORT')->setValues($this->minLength->getCriterias())); 
     67            throw new stubFilterException($this->rveFactory->create('STRING_TOO_SHORT')->setValues($this->minLength->getCriteria())); 
    6868        // if input is longer than maximal allowed length 
    6969        } elseif (null != $this->maxLength && $this->maxLength->validate($value) == false) { 
    70             throw new stubFilterException($this->rveFactory->create('STRING_TOO_LONG')->setValues($this->maxLength->getCriterias())); 
     70            throw new stubFilterException($this->rveFactory->create('STRING_TOO_LONG')->setValues($this->maxLength->getCriteria())); 
    7171        } 
    7272         
  • trunk/src/main/php/net/stubbles/ipo/request/filters/stubNumberFilter.php

    r97 r140  
    7373        } elseif (null !== $value && null != $this->minValidator && $this->minValidator->validate($value) != true) { 
    7474            // add error message if input is smaller than minimum value 
    75             throw new stubFilterException($this->rveFactory->create('VALUE_TOO_SMALL')->setValues($this->minValidator->getCriterias())); 
     75            throw new stubFilterException($this->rveFactory->create('VALUE_TOO_SMALL')->setValues($this->minValidator->getCriteria())); 
    7676        } elseif (null !== $value && null != $this->maxValidator && $this->maxValidator->validate($value) != true) { 
    7777            // add error message if input is greater than maximum value 
    78             throw new stubFilterException($this->rveFactory->create('VALUE_TOO_GREAT')->setValues($this->maxValidator->getCriterias())); 
     78            throw new stubFilterException($this->rveFactory->create('VALUE_TOO_GREAT')->setValues($this->maxValidator->getCriteria())); 
    7979        } 
    8080         
  • trunk/src/main/php/net/stubbles/ipo/request/filters/stubPasswordFilter.php

    r97 r140  
    7373         
    7474        if ($this->minLength->validate($value) == false) { 
    75             throw new stubFilterException($this->rveFactory->create('STRING_TOO_SHORT')->setValues($this->minLength->getCriterias())); 
     75            throw new stubFilterException($this->rveFactory->create('STRING_TOO_SHORT')->setValues($this->minLength->getCriteria())); 
    7676        } 
    7777         
  • trunk/src/test/php/net/stubbles/helper/BinfordTestCase.php

    r98 r140  
    3232     
    3333    /** 
    34      * assure that values are returned as they are put into the registry 
     34     * assure that values are returned as expected 
    3535     */ 
    3636    public function testValidate() 
     
    4141        $this->assertFalse($this->binford->validate('Bob Vila')); 
    4242    } 
     43     
     44    /** 
     45     * assure that values are returned as expected 
     46     */ 
     47    public function testGetCriteria() 
     48    { 
     49        $this->assertEqual($this->binford->getCriteria(), array('allowedValues' => array(Binford::POWER, 'Binford', 'Binford ' . Binford::POWER))); 
     50    } 
    4351 
    4452    /** 
    45      * assure that values are returned as they are put into the config registry 
     53     * assure that values are returned as expected 
    4654     */ 
    4755    public function testFilter() 
  • trunk/src/test/php/net/stubbles/helper/validators/stubAndValidatorTestCase.php

    r98 r140  
    6262    { 
    6363        $mockValidator1 = new MockstubValidator(); 
    64         $mockValidator1->setReturnValue('getCriterias', array('foo' => 'bar')); 
     64        $mockValidator1->setReturnValue('getCriteria', array('foo' => 'bar')); 
    6565        $this->andValidator->addValidator($mockValidator1); 
    6666        $mockValidator2 = new MockstubValidator(); 
    67         $mockValidator2->setReturnValue('getCriterias', array('bar' => 'baz')); 
     67        $mockValidator2->setReturnValue('getCriteria', array('bar' => 'baz')); 
    6868        $this->andValidator->addValidator($mockValidator2); 
    69         $this->assertEqual($this->andValidator->getCriterias(), array('foo' => 'bar', 'bar' => 'baz')); 
     69        $this->assertEqual($this->andValidator->getCriteria(), array('foo' => 'bar', 'bar' => 'baz')); 
    7070    } 
    7171} 
  • trunk/src/test/php/net/stubbles/helper/validators/stubEqualValidatorTestCase.php

    r98 r140  
    8686    { 
    8787        $equalValidator = new stubEqualValidator(5); 
    88         $this->assertEqual($equalValidator->getCriterias(), array('expected' => 5)); 
     88        $this->assertEqual($equalValidator->getCriteria(), array('expected' => 5)); 
    8989         
    9090        $equalValidator = new stubEqualValidator('foo'); 
    91         $this->assertEqual($equalValidator->getCriterias(), array('expected' => 'foo')); 
     91        $this->assertEqual($equalValidator->getCriteria(), array('expected' => 'foo')); 
    9292         
    9393        $equalValidator = new stubEqualValidator(true); 
    94         $this->assertEqual($equalValidator->getCriterias(), array('expected' => true)); 
     94        $this->assertEqual($equalValidator->getCriteria(), array('expected' => true)); 
    9595         
    9696        $equalValidator = new stubEqualValidator(false); 
    97         $this->assertEqual($equalValidator->getCriterias(), array('expected' => false)); 
     97        $this->assertEqual($equalValidator->getCriteria(), array('expected' => false)); 
    9898         
    9999        $equalValidator = new stubEqualValidator(null); 
    100         $this->assertEqual($equalValidator->getCriterias(), array('expected' => null)); 
     100        $this->assertEqual($equalValidator->getCriteria(), array('expected' => null)); 
    101101    } 
    102102} 
  • trunk/src/test/php/net/stubbles/helper/validators/stubMaxLengthValidatorTestCase.php

    r98 r140  
    4848    public function testGetCriteria() 
    4949    { 
    50         $this->assertEqual($this->maxLengthValidator->getCriterias(), array('maxLength' => 5)); 
     50        $this->assertEqual($this->maxLengthValidator->getCriteria(), array('maxLength' => 5)); 
    5151    } 
    5252} 
  • trunk/src/test/php/net/stubbles/helper/validators/stubMaxNumberValidatorTestCase.php

    r98 r140  
    5050    public function testGetCriteria() 
    5151    { 
    52         $this->assertEqual($this->maxNumberValidator->getCriterias(), array('maxNumber' => 5)); 
     52        $this->assertEqual($this->maxNumberValidator->getCriteria(), array('maxNumber' => 5)); 
    5353    } 
    5454} 
  • trunk/src/test/php/net/stubbles/helper/validators/stubMinLengthValidatorTestCase.php

    r98 r140  
    4848    public function testGetCriteria() 
    4949    { 
    50         $this->assertEqual($this->minLengthValidator->getCriterias(), array('minLength' => 5)); 
     50        $this->assertEqual($this->minLengthValidator->getCriteria(), array('minLength' => 5)); 
    5151    } 
    5252} 
  • trunk/src/test/php/net/stubbles/helper/validators/stubMinNumberValidatorTestCase.php

    r98 r140  
    5050    public function testGetCriteria() 
    5151    { 
    52         $this->assertEqual($this->minNumberValidator->getCriterias(), array('minNumber' => 5)); 
     52        $this->assertEqual($this->minNumberValidator->getCriteria(), array('minNumber' => 5)); 
    5353    } 
    5454}