Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-01-2012, 01:28 PM   PM User | #1
helloise
New Coder

 
Join Date: Jan 2011
Posts: 79
Thanks: 7
Thanked 0 Times in 0 Posts
helloise has a little shameless behaviour in the past
Not finding my class sfValidatorString

i have a unit test that call this line:

phoenix/test/phpunit/unit/RbcTest.php:
PHP Code:
$coverage->start('strtolowerTest.php');
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?
thanks
helloise is offline   Reply With Quote
Reply

Bookmarks

Tags
php

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:13 AM.


Advertisement
Log in to turn off these ads.