2009/11/20 Peter Theill <the...@gmail.com>

> I have added "setUid" and "getUid" methods in my "myUser.class.php"
> but when I'm running my functional tests I'm not able to use these
> methods. I get:
>
>  sfException: Call to undefined method myUser::setUid.
>
> My "myUser.php.class" looks like this:
>
> <?php
>
> class myUser extends sfBasicSecurityUser {
>
>        public function getUid() {
>                return $this->getAttribute('username');
>        }
>
>        public function setUid($uid) {
>                $this->setAttribute('username', $uid);
>                $this->setAuthenticated(!empty($uid));
>        }
> }
>
> My test class (which fails) looks like:
>
> <?php
>
> include(dirname(__FILE__).'/../../bootstrap/functional.php');
>
> $browser = new sfTestFunctional(new sfBrowser());
> $browser->
>        get('/handins')->
>        setField('sessions[username]', 'john.doe')->
>        setField('sessions[password]', '123456')->
>        click('Connect')->
>        isRedirected()->
>
> It fails in the controller where I call:
>
>  $this->getUser()->setUid($form['username']->getValue());
>
>
> I would like to use my "myUser" in my test environment as well but it
> seems like it's using "sfTesterUser" which doesn't have these
> methods.
>
> How would I solve this properly?
>
>
>

I have this issue also, the subclass myUser is working correclty when
viewing the page on the browser but an exception is thrown when calling from
testing environment.

last lines of debug
500 | Internal Server Error | sfException Call to undefined method
myUser::findCulture. stack trace

   - at () in SF_ROOT_DIR/lib/symfony-1.2.9/lib/user/sfUser.class.php line
   285
   - at sfUser->__call('findCulture', array(*object*('sfWebRequest'))) in
   n/a line n/a

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.


Reply via email to