[dokuwiki] unit tests : global $auth

  • From: Guillaume Turri <guillaume.turri@xxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Sat, 29 Oct 2011 18:37:50 +0200

Hi,

I tried to run the unit tests from a fresh cloned Dokuwiki, according to the
documentation [1].

I have some failure with tests in auth_aclcheck.test.php; in particular with
the assertions :
> $this->assertEqual(auth_aclcheck('page',
'jill',array('foo','user')), AUTH_UPLOAD);
>
$this->assertEqual(auth_aclcheck('namespace:page','jill',array('foo','user')),
AUTH_UPLOAD);
> $this->assertEqual(auth_aclcheck('namespace:*',
'jill',array('foo','user')), AUTH_UPLOAD);

The expected value it AUTH_UPLOAD, but auth_aclcheck returns AUTH_NONE. It
does so because the global $auth is null (therefore, L497 of auth.php
returns AUTH_NONE)

It looks like the global $auth could be initialized by auth_setup(), but
this fonction isn't used (and, tweaking a bit, it seems that adding brutally
a call to it doesn't fix my issue)

Since it's the first time I try to run those tests, I suppose I missed
something, but what? What have I done wrong? Should this test pass just
after cloning (and tweaking tests.ini), or have I missed a step?

Regards,
Guillaume


[1] : http://www.dokuwiki.org/devel:unittesting

Other related posts: