diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2018-05-28 13:17:22 +0300 |
---|---|---|
committer | Matthieu Aubry <mattab@users.noreply.github.com> | 2018-05-28 13:17:22 +0300 |
commit | 51e725ede4378df7eeab296335ec5dab6a026b94 (patch) | |
tree | b7b33133d41f4585ef9be6e61ca8047aeeaacc35 /tests/PHPUnit/System/ExternalScriptsTest.php | |
parent | 0e70009736f2a874d78aa3388d8cce2f65cfdb41 (diff) |
Remove internal API example (#12996)
Diffstat (limited to 'tests/PHPUnit/System/ExternalScriptsTest.php')
-rw-r--r-- | tests/PHPUnit/System/ExternalScriptsTest.php | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/tests/PHPUnit/System/ExternalScriptsTest.php b/tests/PHPUnit/System/ExternalScriptsTest.php deleted file mode 100644 index 950f2bb9e6..0000000000 --- a/tests/PHPUnit/System/ExternalScriptsTest.php +++ /dev/null @@ -1,46 +0,0 @@ -<?php -/** - * Piwik - free/libre analytics platform - * - * @link http://piwik.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -namespace Piwik\Tests\System; - -use Piwik\DbHelper; -use Piwik\Tests\Framework\Fixture; -use Piwik\Tests\Framework\TestCase\SystemTestCase; - -class ExternalScriptsTest extends SystemTestCase -{ - public static function setUpBeforeClass() - { - parent::setUpBeforeClass(); - - DbHelper::createAnonymousUser(); - - // the api_internal_call.php uses idSite=7, so we create 7 sites - for ($i = 0; $i != 7; ++$i) { - Fixture::createWebsite("2011-01-01 00:00:00", $ecommerce = 1, $siteName = "Site #$i"); - } - - // the script uses anonymous token auth, so give the anonymous user access - \Piwik\Plugins\UsersManager\API::getInstance()->setUserAccess('anonymous', 'view', array(7)); - } - - public function test_ApiInternalCallScript_ExecutesCorrectly() - { - $output = $this->executeApiInternalCall(); - $expectedFileOutput = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<result />"; - $this->assertEquals($expectedFileOutput, $output); - } - - private function executeApiInternalCall() - { - $proxyIncludeScript = PIWIK_INCLUDE_PATH . '/tests/PHPUnit/proxy/include_single_file.php'; - $apiInternalCallScript = PIWIK_INCLUDE_PATH . '/misc/others/api_internal_call.php'; - - $command = "php '$proxyIncludeScript' '$apiInternalCallScript' 2>&1"; - return shell_exec($command); - } -} |