diff options
Diffstat (limited to 'plugins')
31 files changed, 54 insertions, 62 deletions
diff --git a/plugins/Actions/tests/Unit/ArchiverTest.php b/plugins/Actions/tests/Unit/ArchiverTest.php index d0f7d42543..9c7cae8f7e 100644 --- a/plugins/Actions/tests/Unit/ArchiverTest.php +++ b/plugins/Actions/tests/Unit/ArchiverTest.php @@ -9,8 +9,8 @@ namespace Piwik\Plugins\Actions\tests\Unit; use Piwik\Plugins\Actions\ArchivingHelper; +use Piwik\Tests\Framework\Fixture; use Piwik\Tracker\Action; -use Piwik\Translate; require_once PIWIK_INCLUDE_PATH . '/plugins/Actions/Actions.php'; @@ -23,12 +23,12 @@ class ArchiverTests extends \PHPUnit\Framework\TestCase { public function setUp() { - Translate::loadAllTranslations(); + Fixture::loadAllTranslations(); } public function tearDown() { - Translate::reset(); + Fixture::resetTranslations(); } public function getActionNameTestData() diff --git a/plugins/Contents/tests/System/ContentsTest.php b/plugins/Contents/tests/System/ContentsTest.php index 06061fe605..363463b4da 100644 --- a/plugins/Contents/tests/System/ContentsTest.php +++ b/plugins/Contents/tests/System/ContentsTest.php @@ -7,9 +7,9 @@ */ namespace Piwik\Plugins\Contents\tests\System; +use Piwik\Tests\Framework\Fixture; use Piwik\Tests\Framework\TestCase\SystemTestCase; use Piwik\Plugins\Contents\tests\Fixtures\TwoVisitsWithContents; -use Piwik\Translate; /** * Testing Contents @@ -48,13 +48,13 @@ class ContentsTest extends SystemTestCase protected function setup() { parent::setup(); - Translate::loadAllTranslations(); + Fixture::loadAllTranslations(); } protected function tearDown() { parent::tearDown(); - Translate::reset(); + Fixture::resetTranslations(); } public function getApiForTesting() diff --git a/plugins/CoreConsole/Commands/GenerateReport.php b/plugins/CoreConsole/Commands/GenerateReport.php index a7e3af28d0..d9bad9f209 100644 --- a/plugins/CoreConsole/Commands/GenerateReport.php +++ b/plugins/CoreConsole/Commands/GenerateReport.php @@ -10,11 +10,10 @@ namespace Piwik\Plugins\CoreConsole\Commands; use Piwik\Columns\Dimension; +use Piwik\Container\StaticContainer; use Piwik\Piwik; use Piwik\Plugin\Manager; -use Piwik\Plugin\Report; use Piwik\Plugin\ReportsProvider; -use Piwik\Translate; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; @@ -210,7 +209,7 @@ class GenerateReport extends GeneratePluginBase $validate($category); } - $translationKey = Translate::findTranslationKeyForTranslation($category); + $translationKey = StaticContainer::get('Piwik\Translation\Translator')->findTranslationKeyForTranslation($category); if (!empty($translationKey)) { return $translationKey; } diff --git a/plugins/CoreConsole/Commands/GenerateWidget.php b/plugins/CoreConsole/Commands/GenerateWidget.php index 5968ea8a04..20624b3ba0 100644 --- a/plugins/CoreConsole/Commands/GenerateWidget.php +++ b/plugins/CoreConsole/Commands/GenerateWidget.php @@ -9,9 +9,9 @@ namespace Piwik\Plugins\CoreConsole\Commands; +use Piwik\Container\StaticContainer; use Piwik\Piwik; use Piwik\Plugin\Manager; -use Piwik\Translate; use Piwik\Widget\WidgetsList; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -125,7 +125,7 @@ class GenerateWidget extends GeneratePluginBase /** * @param InputInterface $input * @param OutputInterface $output - * @return array + * @return string * @throws \RuntimeException */ protected function getCategory(InputInterface $input, OutputInterface $output) @@ -148,7 +148,7 @@ class GenerateWidget extends GeneratePluginBase $validate($category); } - $translationKey = Translate::findTranslationKeyForTranslation($category); + $translationKey = StaticContainer::get('Piwik\Translation\Translator')->findTranslationKeyForTranslation($category); if (!empty($translationKey)) { return $translationKey; } @@ -161,7 +161,7 @@ class GenerateWidget extends GeneratePluginBase /** * @param InputInterface $input * @param OutputInterface $output - * @return array + * @return string * @throws \RuntimeException */ protected function getPluginName(InputInterface $input, OutputInterface $output) diff --git a/plugins/CoreVisualizations/tests/Integration/SparklinesConfigTest.php b/plugins/CoreVisualizations/tests/Integration/SparklinesConfigTest.php index 6847ac7b2c..5ab9f88296 100644 --- a/plugins/CoreVisualizations/tests/Integration/SparklinesConfigTest.php +++ b/plugins/CoreVisualizations/tests/Integration/SparklinesConfigTest.php @@ -12,7 +12,6 @@ use Piwik\Plugins\CoreVisualizations\Visualizations\Sparklines\Config; use Piwik\Tests\Framework\Fixture; use Piwik\Tests\Framework\Mock\FakeAccess; use Piwik\Tests\Framework\TestCase\IntegrationTestCase; -use Piwik\Translate; /** * @group CoreVisualizations @@ -37,12 +36,12 @@ class SparklinesConfigTest extends IntegrationTestCase $this->config = new Config(); - Translate::loadAllTranslations(); + Fixture::loadAllTranslations(); } public function tearDown() { - Translate::reset(); + Fixture::resetTranslations(); parent::tearDown(); } diff --git a/plugins/CustomAlerts b/plugins/CustomAlerts -Subproject 3a785ec4bb71dcdeebca941bd76098b22299916 +Subproject 5633bb4bb70d1c3fd99bef6ecd7cb32b52f7a92 diff --git a/plugins/CustomDimensions b/plugins/CustomDimensions -Subproject 16cda6608a317c283521b35bed014f8d1a2b22d +Subproject b410ab4d5c2e8e3f0a5236a887627f49198554e diff --git a/plugins/DeviceDetectorCache b/plugins/DeviceDetectorCache -Subproject e69f4eb28eec088fce7062bc4041f644f1a251a +Subproject 9564937792966a0df33ed03fd6035bbac81e4d4 diff --git a/plugins/Feedback/API.php b/plugins/Feedback/API.php index fdfe0adc43..de32971f16 100644 --- a/plugins/Feedback/API.php +++ b/plugins/Feedback/API.php @@ -9,10 +9,10 @@ namespace Piwik\Plugins\Feedback; use Piwik\Common; use Piwik\Config; +use Piwik\Container\StaticContainer; use Piwik\IP; use Piwik\Mail; use Piwik\Piwik; -use Piwik\Translate; use Piwik\Url; use Piwik\Version; @@ -80,11 +80,13 @@ class API extends \Piwik\Plugin\API private function getEnglishTranslationForFeatureName($featureName) { - if (Translate::getLanguageLoaded() == 'en') { + $translator = StaticContainer::get('Piwik\Translation\Translator'); + + if ($translator->getCurrentLanguage() == 'en') { return $featureName; } - $translationKeyForFeature = Translate::findTranslationKeyForTranslation($featureName); + $translationKeyForFeature = $translator->findTranslationKeyForTranslation($featureName); return Piwik::translate($translationKeyForFeature, array(), 'en'); } diff --git a/plugins/GeoIp2/tests/System/ConvertRegionCodesToIsoTest.php b/plugins/GeoIp2/tests/System/ConvertRegionCodesToIsoTest.php index 06b0cc1d2f..abf144ec40 100644 --- a/plugins/GeoIp2/tests/System/ConvertRegionCodesToIsoTest.php +++ b/plugins/GeoIp2/tests/System/ConvertRegionCodesToIsoTest.php @@ -14,7 +14,6 @@ use Piwik\Plugins\UserCountry\LocationProvider; use Piwik\Plugins\GeoIp2\LocationProvider\GeoIp2; use Piwik\Tests\Framework\Fixture; use Piwik\Tests\Framework\TestCase\IntegrationTestCase; -use Piwik\Translate; use Symfony\Component\Console\Application; use Symfony\Component\Console\Tester\CommandTester; @@ -126,7 +125,7 @@ class ConvertRegionCodesToIsoTest extends IntegrationTestCase ); // we need to manually reload the translations since they get reset for some reason in IntegrationTestCase::tearDown(); - Translate::loadAllTranslations(); + Fixture::loadAllTranslations(); $this->assertApiResponseEqualsExpected("UserCountry.getRegion", $queryParams); $this->assertApiResponseEqualsExpected("UserCountry.getCountry", $queryParams); diff --git a/plugins/ImageGraph/API.php b/plugins/ImageGraph/API.php index e0e064a591..1fa00cca13 100644 --- a/plugins/ImageGraph/API.php +++ b/plugins/ImageGraph/API.php @@ -12,12 +12,12 @@ use Exception; use Piwik\API\Request; use Piwik\Archive\DataTableFactory; use Piwik\Common; +use Piwik\Container\StaticContainer; use Piwik\DataTable\Map; use Piwik\Filesystem; use Piwik\Period; use Piwik\Piwik; use Piwik\SettingsServer; -use Piwik\Translate; /** * The ImageGraph.get API call lets you generate beautiful static PNG Graphs for any existing Matomo report. @@ -139,7 +139,7 @@ class API extends \Piwik\Plugin\API $useUnicodeFont = array( 'am', 'ar', 'el', 'fa', 'fi', 'he', 'ja', 'ka', 'ko', 'te', 'th', 'zh-cn', 'zh-tw', ); - $languageLoaded = Translate::getLanguageLoaded(); + $languageLoaded = StaticContainer::get('Piwik\Translation\Translator')->getCurrentLanguage(); $font = self::getFontPath(self::DEFAULT_FONT); if (in_array($languageLoaded, $useUnicodeFont)) { $unicodeFontPath = self::getFontPath(self::UNICODE_FONT); diff --git a/plugins/Insights/tests/Integration/ApiTest.php b/plugins/Insights/tests/Integration/ApiTest.php index 5c3f616513..774a9e54c5 100644 --- a/plugins/Insights/tests/Integration/ApiTest.php +++ b/plugins/Insights/tests/Integration/ApiTest.php @@ -11,11 +11,10 @@ namespace Piwik\Plugins\Insights\tests\Integration; use Piwik\API\Request as ApiRequest; use Piwik\Cache as PiwikCache; use Piwik\DataTable; -use Piwik\DataTable\Row; use Piwik\Plugins\Insights\API; use Piwik\Plugins\Insights\tests\Fixtures\SomeVisitsDifferentPathsOnTwoDays; +use Piwik\Tests\Framework\Fixture; use Piwik\Tests\Framework\TestCase\SystemTestCase; -use Piwik\Translate; /** * @group Insights @@ -42,7 +41,7 @@ class ApiTest extends SystemTestCase PiwikCache::flushAll(); - Translate::loadAllTranslations(); + Fixture::loadAllTranslations(); $this->api = API::getInstance(); } @@ -50,7 +49,7 @@ class ApiTest extends SystemTestCase { parent::tearDown(); - Translate::reset(); + Fixture::resetTranslations(); } /** diff --git a/plugins/LanguagesManager/LanguagesManager.php b/plugins/LanguagesManager/LanguagesManager.php index e24651d4b7..d38176377b 100644 --- a/plugins/LanguagesManager/LanguagesManager.php +++ b/plugins/LanguagesManager/LanguagesManager.php @@ -15,11 +15,9 @@ use Piwik\Common; use Piwik\Config; use Piwik\Container\StaticContainer; use Piwik\Cookie; -use Piwik\Db; use Piwik\Intl\Locale; use Piwik\Piwik; use Piwik\ProxyHttp; -use Piwik\Translate; use Piwik\Translation\Translator; use Piwik\View; @@ -156,7 +154,7 @@ class LanguagesManager extends \Piwik\Plugin $languageCode = Common::extractLanguageCodeFromBrowserLanguage(Common::getBrowserLanguage(), API::getInstance()->getAvailableLanguages()); } if (!API::getInstance()->isLanguageAvailable($languageCode)) { - $languageCode = Translate::getLanguageDefault(); + $languageCode = StaticContainer::get('Piwik\Translation\Translator')->getDefaultLanguage(); } return $languageCode; } diff --git a/plugins/LanguagesManager/TranslationWriter/Filter/EncodedEntities.php b/plugins/LanguagesManager/TranslationWriter/Filter/EncodedEntities.php index dd1146f581..3e2c9dbb5b 100644 --- a/plugins/LanguagesManager/TranslationWriter/Filter/EncodedEntities.php +++ b/plugins/LanguagesManager/TranslationWriter/Filter/EncodedEntities.php @@ -9,7 +9,7 @@ namespace Piwik\Plugins\LanguagesManager\TranslationWriter\Filter; -use Piwik\Translate; +use Piwik\Container\StaticContainer; class EncodedEntities extends FilterAbstract { @@ -38,12 +38,12 @@ class EncodedEntities extends FilterAbstract foreach ($pluginTranslations as $key => $translation) { if (isset($this->baseTranslations[$pluginName][$key]) && - $this->baseTranslations[$pluginName][$key] != Translate::clean($this->baseTranslations[$pluginName][$key])) { + $this->baseTranslations[$pluginName][$key] != StaticContainer::get('Piwik\Translation\Translator')->clean($this->baseTranslations[$pluginName][$key])) { continue; // skip if base translation already contains encoded entities } // remove encoded entities - $decoded = Translate::clean($translation); + $decoded = StaticContainer::get('Piwik\Translation\Translator')->clean($translation); if ($translation != $decoded) { $this->filteredData[$pluginName][$key] = $translation; $translations[$pluginName][$key] = $decoded; diff --git a/plugins/LanguagesManager/tests/Integration/LanguagesManagerTest.php b/plugins/LanguagesManager/tests/Integration/LanguagesManagerTest.php index 4fb839a3d1..60501c6b49 100644 --- a/plugins/LanguagesManager/tests/Integration/LanguagesManagerTest.php +++ b/plugins/LanguagesManager/tests/Integration/LanguagesManagerTest.php @@ -20,7 +20,7 @@ use Piwik\Plugins\LanguagesManager\TranslationWriter\Filter\UnnecassaryWhitespac use Piwik\Plugins\LanguagesManager\TranslationWriter\Validate\CoreTranslations; use Piwik\Plugins\LanguagesManager\TranslationWriter\Validate\NoScripts; use Piwik\Plugins\LanguagesManager\TranslationWriter\Writer; -use Piwik\Translate; +use Piwik\Tests\Framework\Fixture; /** * @group LanguagesManager @@ -145,7 +145,7 @@ class LanguagesManagerTest extends \PHPUnit\Framework\TestCase Cache::flushAll(); $translator = StaticContainer::get('Piwik\Translation\Translator'); $translator->reset(); - Translate::loadAllTranslations(); + Fixture::loadAllTranslations(); $translations = $translator->getAllTranslations(); foreach ($translations AS $plugin => $pluginTranslations) { foreach ($pluginTranslations as $key => $pluginTranslation) { @@ -166,7 +166,7 @@ class LanguagesManagerTest extends \PHPUnit\Framework\TestCase Cache::flushAll(); $translator = StaticContainer::get('Piwik\Translation\Translator'); $translator->reset(); - Translate::loadAllTranslations(); + Fixture::loadAllTranslations(); $translations = $translator->getAllTranslations(); foreach ($translations AS $plugin => $pluginTranslations) { if ($plugin == 'Intl') { diff --git a/plugins/LogViewer b/plugins/LogViewer -Subproject 689930e54b95baa34b4221a769ed1ebedb410d2 +Subproject 3eced789364b3762e8365805164c94d1255324a diff --git a/plugins/LoginLdap b/plugins/LoginLdap -Subproject 8c8e16cd01dcfc3363cbe43e135de60c6bc17f4 +Subproject 79c85ea17b40484454665d0a93e3dfd43fb2c63 diff --git a/plugins/MarketingCampaignsReporting b/plugins/MarketingCampaignsReporting -Subproject 6c8d9a33be10675d3d46632a0d185f18053ebb9 +Subproject 1ba5f4eb0169aaf0670f6ab3d4b1153b6114f31 diff --git a/plugins/Marketplace/tests/Integration/Plugins/InvalidLicensesTest.php b/plugins/Marketplace/tests/Integration/Plugins/InvalidLicensesTest.php index 1d3203548b..1508ba67eb 100644 --- a/plugins/Marketplace/tests/Integration/Plugins/InvalidLicensesTest.php +++ b/plugins/Marketplace/tests/Integration/Plugins/InvalidLicensesTest.php @@ -14,9 +14,9 @@ use Piwik\Container\StaticContainer; use Piwik\Plugins\Marketplace\Consumer; use Piwik\Plugins\Marketplace\Plugins; use Piwik\Plugins\Marketplace\Plugins\InvalidLicenses; +use Piwik\Tests\Framework\Fixture; use Piwik\Tests\Framework\TestCase\IntegrationTestCase; use Piwik\Plugins\Marketplace\tests\Framework\Mock\Consumer as ConsumerBuilder; -use Piwik\Translate; class CustomInvalidLicenses extends InvalidLicenses { private $isActivated = true; @@ -51,14 +51,14 @@ class InvalidLicensesTest extends IntegrationTestCase { parent::setUp(); - Translate::loadEnglishTranslation(); + Fixture::loadAllTranslations(); $this->cache = new Eager(new ArrayCache(), 'test'); } public function tearDown() { - Translate::unloadEnglishTranslation(); + Fixture::resetTranslations(); parent::tearDown(); } diff --git a/plugins/MultiSites/tests/Integration/DashboardTest.php b/plugins/MultiSites/tests/Integration/DashboardTest.php index 782d98e372..b892e230e2 100644 --- a/plugins/MultiSites/tests/Integration/DashboardTest.php +++ b/plugins/MultiSites/tests/Integration/DashboardTest.php @@ -13,7 +13,6 @@ use Piwik\Period; use Piwik\Plugins\MultiSites\Dashboard; use Piwik\Tests\Framework\Fixture; use Piwik\Tests\Framework\TestCase\IntegrationTestCase; -use Piwik\Translate; /** * @group MultiSites @@ -38,7 +37,7 @@ class DashboardTest extends IntegrationTestCase Fixture::createWebsite('2012-12-12 00:00:00', $ecommerce = 0, 'Site ' . $i); } - Translate::loadAllTranslations(); + Fixture::loadAllTranslations(); $this->dashboard = $this->getMockBuilder('Piwik\Plugins\MultiSites\Dashboard') ->setMethods(null) diff --git a/plugins/PrivacyManager/tests/Integration/Dao/LogDataAnonymizerTest.php b/plugins/PrivacyManager/tests/Integration/Dao/LogDataAnonymizerTest.php index c5b50bdd1d..56a4b251b5 100644 --- a/plugins/PrivacyManager/tests/Integration/Dao/LogDataAnonymizerTest.php +++ b/plugins/PrivacyManager/tests/Integration/Dao/LogDataAnonymizerTest.php @@ -16,9 +16,9 @@ use Piwik\Plugins\PrivacyManager\API; use Piwik\Plugins\PrivacyManager\Dao\LogDataAnonymizer; use Piwik\Plugins\PrivacyManager\PrivacyManager; use Piwik\Plugins\PrivacyManager\tests\Fixtures\MultipleSitesMultipleVisitsFixture; +use Piwik\Tests\Framework\Fixture; use Piwik\Tests\Framework\TestCase\IntegrationTestCase; use Piwik\Tracker\Cache; -use Piwik\Translate; /** * Class LogDataAnonymizationsTest @@ -42,7 +42,7 @@ class LogDataAnonymizerTest extends IntegrationTestCase Option::set(PrivacyManager::OPTION_USERID_SALT, 'simpleuseridsalt1'); Cache::clearCacheGeneral(); - Translate::loadEnglishTranslation(); + Fixture::loadAllTranslations(); $this->anonymizer = new LogDataAnonymizer(); $this->theFixture = new MultipleSitesMultipleVisitsFixture(); diff --git a/plugins/Provider b/plugins/Provider -Subproject 597b20133c351b142cb5d57acdcf719e6bdd226 +Subproject 65ad2d63ab289ca3dc032a3e4dc4d28c35582cc diff --git a/plugins/QueuedTracking b/plugins/QueuedTracking -Subproject 0ac5129edc1cde7e5c379c75615f9d4068ec384 +Subproject 58a0d80f275d3f413ba25d0a5a6ec8856273346 diff --git a/plugins/ScheduledReports/API.php b/plugins/ScheduledReports/API.php index 3143bcd294..bbc800fd20 100644 --- a/plugins/ScheduledReports/API.php +++ b/plugins/ScheduledReports/API.php @@ -30,7 +30,6 @@ use Piwik\Plugins\SitesManager\API as SitesManagerApi; use Piwik\ReportRenderer; use Piwik\Scheduler\Schedule\Schedule; use Piwik\Site; -use Piwik\Translate; use Piwik\Translation\Translator; use Psr\Log\LoggerInterface; @@ -323,13 +322,14 @@ class API extends \Piwik\Plugin\API $outputType = self::OUTPUT_DOWNLOAD; } + /** @var Translator $translator */ + $translator = StaticContainer::get('Piwik\Translation\Translator'); + // load specified language if (empty($language)) { - $language = Translate::getLanguageDefault(); + $language = $translator->getDefaultLanguage(); } - /** @var Translator $translator */ - $translator = StaticContainer::get('Piwik\Translation\Translator'); $translator->setCurrentLanguage($language); $reports = $this->getReports($idSite = false, $_period = false, $idReport); diff --git a/plugins/SegmentEditor/tests/Integration/SegmentFormatterTest.php b/plugins/SegmentEditor/tests/Integration/SegmentFormatterTest.php index 9d314fd930..8d03a23c38 100644 --- a/plugins/SegmentEditor/tests/Integration/SegmentFormatterTest.php +++ b/plugins/SegmentEditor/tests/Integration/SegmentFormatterTest.php @@ -12,8 +12,6 @@ use Piwik\Plugins\SegmentEditor\SegmentFormatter; use Piwik\Plugins\SegmentEditor\SegmentList; use Piwik\Tests\Framework\Fixture; use Piwik\Tests\Framework\TestCase\IntegrationTestCase; -use Piwik\Translate; -use Exception; /** * @group SegmentFormatterTest @@ -37,12 +35,12 @@ class SegmentFormatterTest extends IntegrationTestCase $this->idSite = Fixture::createWebsite('2012-01-01 00:00:00'); $this->formatter = new SegmentFormatter(new SegmentList()); - Translate::loadAllTranslations(); + Fixture::loadAllTranslations(); } public function tearDown() { - Translate::reset(); + Fixture::resetTranslations(); } public function test_getHumanReadable_noSegmentGiven_ShouldReturnDefaultSegment() diff --git a/plugins/SitesManager/tests/Integration/ApiTest.php b/plugins/SitesManager/tests/Integration/ApiTest.php index 2f178434fa..90493fb7cf 100644 --- a/plugins/SitesManager/tests/Integration/ApiTest.php +++ b/plugins/SitesManager/tests/Integration/ApiTest.php @@ -18,9 +18,9 @@ use Piwik\Plugins\SitesManager\Model; use Piwik\Plugins\UsersManager\API as APIUsersManager; use Piwik\Measurable\Measurable; use Piwik\Site; +use Piwik\Tests\Framework\Fixture; use Piwik\Tests\Framework\Mock\FakeAccess; use Piwik\Tests\Framework\TestCase\IntegrationTestCase; -use Piwik\Translate; use Exception; use PHPUnit_Framework_Constraint_IsType; @@ -47,7 +47,7 @@ class ApiTest extends IntegrationTestCase { parent::tearDown(); - Translate::reset(); + Fixture::resetTranslations(); } /** @@ -558,7 +558,7 @@ class ApiTest extends IntegrationTestCase API::getInstance()->addSite("site2", array("http://piwik.com/test/")); API::getInstance()->addSite("site3", array("http://piwik.org"), null, null, null, null, null, null, 'Asia/Tokyo'); - Translate::loadAllTranslations(); + Fixture::loadAllTranslations(); $resultWanted = array( 0 => array("idsite" => 1, "name" => "site1", "main_url" => "http://piwik.net", "ecommerce" => 0, "excluded_ips" => "", 'sitesearch' => 1, 'sitesearch_keyword_parameters' => '', 'sitesearch_category_parameters' => '', 'excluded_parameters' => '', 'excluded_user_agents' => '', 'timezone' => 'UTC', 'timezone_name' => 'UTC', 'currency' => 'USD', 'group' => '', 'keep_url_fragment' => 0, 'type' => 'website', 'exclude_unknown_urls' => 0, 'currency_name' => 'US Dollar'), diff --git a/plugins/SitesManager/tests/Unit/APITest.php b/plugins/SitesManager/tests/Unit/APITest.php index 30f6a3497d..564bc977ec 100644 --- a/plugins/SitesManager/tests/Unit/APITest.php +++ b/plugins/SitesManager/tests/Unit/APITest.php @@ -11,7 +11,7 @@ namespace Piwik\Plugins\SitesManager\tests\Unit; use Piwik\Container\StaticContainer; use Piwik\Plugins\SitesManager\API; use Piwik\SettingsServer; -use Piwik\Translate; +use Piwik\Tests\Framework\Fixture; /** * @group SitesManaager @@ -33,7 +33,7 @@ class APITest extends \PHPUnit\Framework\TestCase $this->markTestSkipped('timezones needs to be supported'); } - Translate::loadAllTranslations(); + Fixture::loadAllTranslations(); $this->api = API::getInstance(); } @@ -42,7 +42,7 @@ class APITest extends \PHPUnit\Framework\TestCase { parent::tearDown(); - Translate::reset(); + Fixture::resetTranslations(); } public function getTimezoneNameTestData() diff --git a/plugins/TagManager b/plugins/TagManager -Subproject 6ba750183db9ca2e3ea64751dee592c6f7b7afa +Subproject 935593de7f19e908024cd13ee4f561ca96be1db diff --git a/plugins/UserCountry/tests/System/AttributeHistoricalDataWithLocationsTest.php b/plugins/UserCountry/tests/System/AttributeHistoricalDataWithLocationsTest.php index 6e3d7060f8..e039502239 100644 --- a/plugins/UserCountry/tests/System/AttributeHistoricalDataWithLocationsTest.php +++ b/plugins/UserCountry/tests/System/AttributeHistoricalDataWithLocationsTest.php @@ -10,11 +10,10 @@ namespace Piwik\Plugins\UserCountry\tests\System; use Piwik\Common; use Piwik\Db; -use Piwik\Plugin; use Piwik\Plugins\UserCountry\Commands\AttributeHistoricalDataWithLocations; use Piwik\Tests\Fixtures\ManyVisitsWithGeoIP; +use Piwik\Tests\Framework\Fixture; use Piwik\Tests\Framework\TestCase\IntegrationTestCase; -use Piwik\Translate; use Symfony\Component\Console\Application; use Symfony\Component\Console\Tester\CommandTester; @@ -109,7 +108,7 @@ class AttributeHistoricalDataWithLocationsTest extends IntegrationTestCase // if we do not load translations, a DataTable\Map containing multiple periods will contain only one DataTable having // the label `General_DateRangeFromTo` instead of many like `From 2010-01-04 to 2010-01-11`, ' `From 2010-01-11 to 2010-01-18` // As those data tables would all have the same prettyfied period label they would overwrite each other. - Translate::loadAllTranslations(); + Fixture::loadAllTranslations(); $this->assertApiResponseEqualsExpected("UserCountry.getCountry", $queryParams); $this->assertApiResponseEqualsExpected("UserCountry.getContinent", $queryParams); diff --git a/plugins/UserCountry/tests/Unit/UserCountryTest.php b/plugins/UserCountry/tests/Unit/UserCountryTest.php index ecae4a28cd..b28c5fc9d1 100644 --- a/plugins/UserCountry/tests/Unit/UserCountryTest.php +++ b/plugins/UserCountry/tests/Unit/UserCountryTest.php @@ -12,9 +12,9 @@ use Piwik\Container\StaticContainer; use Piwik\Intl\Data\Provider\RegionDataProvider; use Piwik\Plugins\UserCountry\GeoIPAutoUpdater; use Piwik\Plugins\UserCountry\LocationProvider\GeoIp; -use Piwik\Plugins\UserCountry; use Piwik\Plugins\UserCountry\LocationProvider; use Exception; +use Piwik\Tests\Framework\Fixture; require_once PIWIK_INCLUDE_PATH . '/plugins/UserCountry/UserCountry.php'; require_once PIWIK_INCLUDE_PATH . '/plugins/UserCountry/functions.php'; @@ -110,7 +110,7 @@ class UserCountryTest extends \PHPUnit\Framework\TestCase public function testGeoIpDownloadInvalidUrl($url) { // unset translations, otherwise Exception message will be translated - StaticContainer::get('Piwik\Translation\Translator')->reset(); + Fixture::resetTranslations(); $updater = new Piwik_UserCountry_GeoIPAutoUpdater_publictest(); try { diff --git a/plugins/VisitorGenerator b/plugins/VisitorGenerator -Subproject 2f671813cd59b9d89745f6157ae71e84496a8ea +Subproject 055f3fd695ba386c8de871a849ffd90ba4cb528 |