2014-05-04 21:23:12 +02:00
|
|
|
<?php
|
|
|
|
class AbstractTest
|
|
|
|
{
|
|
|
|
public $assert;
|
2014-05-13 21:08:07 +02:00
|
|
|
protected $postMocker;
|
|
|
|
protected $tagMocker;
|
|
|
|
protected $userMocker;
|
|
|
|
protected $commentMocker;
|
|
|
|
protected $testSupport;
|
2014-05-04 21:23:12 +02:00
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
$this->assert = new Assert();
|
2014-05-13 21:08:07 +02:00
|
|
|
$this->testSupport = new TestSupport($this->assert);
|
|
|
|
$this->tagMocker = new TagMocker();
|
|
|
|
$this->postMocker = new PostMocker($this->tagMocker, $this->testSupport);
|
|
|
|
$this->userMocker = new UserMocker();
|
|
|
|
$this->commentMocker = new CommentMocker($this->postMocker);
|
2014-05-04 21:23:12 +02:00
|
|
|
}
|
2014-05-05 11:08:03 +02:00
|
|
|
|
2014-05-06 18:09:23 +02:00
|
|
|
public function setup()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public function teardown()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-05-05 11:08:03 +02:00
|
|
|
protected function login($user)
|
|
|
|
{
|
|
|
|
Auth::setCurrentUser($user);
|
|
|
|
}
|
|
|
|
|
2014-05-06 13:07:24 +02:00
|
|
|
protected function grantAccess($privilege)
|
|
|
|
{
|
2014-05-15 10:32:53 +02:00
|
|
|
Core::getConfig()->privileges->$privilege = 'anonymous';
|
2014-08-23 14:15:04 +02:00
|
|
|
Access::initWithoutCache();
|
2014-05-06 13:07:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
protected function revokeAccess($privilege)
|
|
|
|
{
|
2014-05-15 10:32:53 +02:00
|
|
|
Core::getConfig()->privileges->$privilege = 'nobody';
|
2014-08-23 14:15:04 +02:00
|
|
|
Access::initWithoutCache();
|
2014-05-06 13:07:24 +02:00
|
|
|
}
|
2014-05-04 21:23:12 +02:00
|
|
|
}
|