namespace Friendica\Test;
+use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Network\BadRequestException;
*/
protected function setUp()
{
+ global $a;
parent::setUp();
+ // Reusable App object
+ $this->app = new App(__DIR__.'/../');
+ $a = $this->app;
+
// User data that the test database is populated with
$this->selfUser = [
'id' => 42,
'authenticated' => true,
'uid' => $this->selfUser['id']
];
+
+ // Default config
+ Config::set('config', 'hostname', 'localhost');
+ Config::set('system', 'throttle_limit_day', 100);
+ Config::set('system', 'throttle_limit_week', 100);
+ Config::set('system', 'throttle_limit_month', 100);
+ Config::set('system', 'theme', 'system_theme');
}
/**
namespace Friendica\Test;
use dba;
-use Friendica\App;
-use Friendica\Core\Config;
use Friendica\Database\DBStructure;
use PHPUnit_Extensions_Database_DB_IDatabaseConnection;
use PHPUnit\DbUnit\DataSet\YamlDataSet;
*/
abstract class DatabaseTest extends TestCase
{
- /**
- * @var \Friendica\App
- */
- protected $app;
use TestCaseTrait;
- /**
- * Creates basic instances for testing with databases
- *
- * @throws \Exception
- */
- protected function setUp()
- {
- global $a;
- parent::setUp();
-
- // Reusable App object
- $this->app = new App(__DIR__.'/../');
- $a = $this->app;
-
- // Default config
- Config::set('config', 'hostname', 'localhost');
- Config::set('system', 'throttle_limit_day', 100);
- Config::set('system', 'throttle_limit_week', 100);
- Config::set('system', 'throttle_limit_month', 100);
- Config::set('system', 'theme', 'system_theme');
- }
-
/**
* Renames an eventually existing .htconfig.php to .htconfig.php.tmp
* Creates a new .htconfig.php for bin/worker.php execution
namespace Friendica\Test\src\Core\Cache;
+use Friendica\App;
+use Friendica\Core\Config;
use Friendica\Test\DatabaseTest;
use Friendica\Util\DateTimeFormat;
protected function setUp()
{
+ global $a;
parent::setUp();
$this->instance = $this->getInstance();
+
+ // Reusable App object
+ $this->app = new App(__DIR__.'/../');
+ $a = $this->app;
+
+ // Default config
+ Config::set('config', 'hostname', 'localhost');
+ Config::set('system', 'throttle_limit_day', 100);
+ Config::set('system', 'throttle_limit_week', 100);
+ Config::set('system', 'throttle_limit_month', 100);
+ Config::set('system', 'theme', 'system_theme');
}
function testSimple() {
namespace Friendica\Test\src\Core\Lock;
+use Friendica\App;
+use Friendica\Core\Config;
use Friendica\Test\DatabaseTest;
+use PHPUnit\Framework\TestCase;
abstract class LockTest extends DatabaseTest
{
protected function setUp()
{
+ global $a;
parent::setUp();
$this->instance = $this->getInstance();
+
+ // Reusable App object
+ $this->app = new App(__DIR__.'/../');
+ $a = $this->app;
+
+ // Default config
+ Config::set('config', 'hostname', 'localhost');
+ Config::set('system', 'throttle_limit_day', 100);
+ Config::set('system', 'throttle_limit_week', 100);
+ Config::set('system', 'throttle_limit_month', 100);
+ Config::set('system', 'theme', 'system_theme');
}
public function testLock() {