]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #6920 from nupplaphil/feature/basepath/hostname_config
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 25 Mar 2019 00:15:13 +0000 (20:15 -0400)
committerGitHub <noreply@github.com>
Mon, 25 Mar 2019 00:15:13 +0000 (20:15 -0400)
Removing basepath/hostname from admin site settings

1  2 
tests/include/ApiTest.php

index df3a7e9401f9335e0fe96a49c64d0e0b0380373d,1eb7ce78d04eb963056388f99c47888ce36af4cf..80a25c20c11fe438f73988ff481e7fe7997d22be
@@@ -7,13 -7,13 +7,13 @@@ namespace Friendica\Test
  
  use Friendica\App;
  use Friendica\Core\Config;
- use Friendica\Core\Config\Cache;
  use Friendica\Core\PConfig;
  use Friendica\Core\Protocol;
  use Friendica\Core\System;
  use Friendica\Factory;
  use Friendica\Network\HTTPException;
  use Friendica\Util\BasePath;
+ use Friendica\Util\Config\ConfigFileLoader;
  use Monolog\Handler\TestHandler;
  
  require_once __DIR__ . '/../../include/api.php';
@@@ -31,18 -31,6 +31,18 @@@ class ApiTest extends DatabaseTes
         */
        protected $logOutput;
  
 +      /** @var App */
 +      protected $app;
 +
 +      /** @var array */
 +      protected $selfUser;
 +      /** @var array */
 +      protected $friendUser;
 +      /** @var array */
 +      protected $otherUser;
 +
 +      protected $wrongUserId;
 +
        /**
         * Create variables used by tests.
         */
        {
                $basePath = BasePath::create(dirname(__DIR__) . '/../');
                $mode = new App\Mode($basePath);
-               $configLoader = new Cache\ConfigCacheLoader($basePath, $mode);
+               $configLoader = new ConfigFileLoader($basePath, $mode);
                $configCache = Factory\ConfigFactory::createCache($configLoader);
                $profiler = Factory\ProfilerFactory::create($configCache);
                Factory\DBFactory::init($basePath, $configCache, $profiler, $_SERVER);
                $config = Factory\ConfigFactory::createConfig($configCache);
                Factory\ConfigFactory::createPConfig($configCache);
                $logger = Factory\LoggerFactory::create('test', $config, $profiler);
-               $this->app = new App($basePath, $config, $mode, $logger, $profiler, false);
+               $this->app = new App($config, $mode, $logger, $profiler, false);
  
                parent::setUp();
  
  
        /**
         * Test the api_status_show() function.
 -       * @return void
         */
 -      public function testApiStatusShow()
 +      public function testApiStatusShowWithJson()
        {
 -              $result = api_status_show('json');
 +              $result = api_status_show('json', 1);
                $this->assertStatus($result['status']);
        }
  
        /**
         * Test the api_status_show() function with an XML result.
 -       * @return void
         */
        public function testApiStatusShowWithXml()
        {
 -              $result = api_status_show('xml');
 +              $result = api_status_show('xml', 1);
                $this->assertXml($result, 'statuses');
        }
  
        /**
 -       * Test the api_status_show() function with a raw result.
 -       * @return void
 +       * Test the api_get_last_status() function
         */
 -      public function testApiStatusShowWithRaw()
 +      public function testApiGetLastStatus()
        {
 -              $this->assertStatus(api_status_show('raw'));
 +              $item = api_get_last_status($this->selfUser['id'], $this->selfUser['id']);
 +
 +              $this->assertNotNull($item);
        }
  
        /**