View Full Version : Not finding my class sfValidatorString

03-01-2012, 01:28 PM
i have a unit test that call this line:

PHP Code:
now in phoenix/test/phpunit/unit/strtolowerTest.ph

PHP Code:
$t = new lime_test(2, new lime_output_color());
$t->is(myValidatorString::slugify('sensio labs'), 'sensio-labs');
$t->is(myValidatorString::slugify('paris,france'), 'paris-france');
$t->is(myValidatorString::slugify(' sensio'), 'sensio');
$t->is(myValidatorString::slugify('sensio '), 'sensio');
$t->is(myValidatorString::slugify(''), 'n-a', '::slugify() converts the empty string to n-a');
$t->is(myValidatorString::slugify(' - '), 'n-a', '::slugify() converts a string that only contains non-ASCII characters to n-a');
then: phoenix/lib/validator/myValidatorString.class.ph
PHP Code:
class myValidatorString extends sfValidatorString

static public function slugify($text)
echo "in myvalidatorstring for class sfValidatorString.class.php";
// replace all non letters or digits by -
$text = preg_replace('/\W+/', '-', $text);

// trim and lowercase
$text = strtolower(trim($text, '-'));

if (empty($text))
return 'n-a';

return $text;
when i run the RbcTest i get an error that it cannot find the class sfValidatorString which is in phoenix/lib/vendor/symfony/lib/validator/sfValidatorString.class.php

how can i fix this please?