namespace Friendica\Test;
+use Friendica\BaseObject;
use Friendica\Core\Config;
use Friendica\Core\PConfig;
use Friendica\Core\Protocol;
/**
* Create variables used by tests.
*/
- protected function setUp()
+ public function setUp()
{
parent::setUp();
- // Reusable App object
- $this->app = \Friendica\BaseObject::getApp();
+ require_once __DIR__.'/../include/api.php';
// User data that the test database is populated with
$this->selfUser = [
Config::set('system', 'theme', 'system_theme');
}
+ /**
+ * Cleanup variables used by tests.
+ */
+ protected function tearDown()
+ {
+ parent::tearDown();
+
+ $app = get_app();
+ $app->argc = 1;
+ $app->argv = ['home'];
+ }
+
/**
* Assert that an user array contains expected keys.
* @param array $user User array
{
$_FILES = [
'media' => [
- 'id' => 666
+ 'id' => 666,
+ 'tmp_name' => 'tmp_name'
]
];
api_media_upload();
*/
public function testApiShareAsRetweet()
{
- $item = ['body' => ''];
+ $item = ['body' => '', 'author-id' => 1, 'owner-id' => 1];
$result = api_share_as_retweet($item);
$this->assertFalse($result);
}