Skip to content
Extraits de code Groupes Projets
Valider 4b79d417 rédigé par diosmosis's avatar diosmosis
Parcourir les fichiers

Fixing integration tests.

parent ac4245ff
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -11,6 +11,7 @@ namespace Piwik\Plugins\CorePluginsAdmin\tests\Integration;
use Piwik\Config;
use Piwik\Option;
use Piwik\Plugins\CorePluginsAdmin\UpdateCommunication;
use Piwik\Tests\Framework\Fixture;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
/**
......@@ -121,7 +122,8 @@ class UpdateCommunicationTest extends IntegrationTestCase
public function test_sendNotificationIfUpdatesAvailable_ShouldSendCorrectText()
{
$subject = 'CoreUpdater_NotificationSubjectAvailablePluginUpdate';
$message = 'ScheduledReports_EmailHello
$rootUrl = Fixture::getTestRootUrl();
$message = "ScheduledReports_EmailHello
CoreUpdater_ThereIsNewPluginVersionAvailableForUpdate
......@@ -130,9 +132,9 @@ CoreUpdater_ThereIsNewPluginVersionAvailableForUpdate
* MyTest3 31.0.0
CoreUpdater_NotificationClickToUpdatePlugins
http://localhost/tests/PHPUnit/proxy/index.php?module=CorePluginsAdmin&action=plugins
{$rootUrl}index.php?module=CorePluginsAdmin&action=plugins
Installation_HappyAnalysing';
Installation_HappyAnalysing";
$mock = $this->getCommunicationMockHavingManyUpdates();
......
......@@ -11,6 +11,7 @@ namespace Piwik\Plugins\CoreUpdater\Test;
use Piwik\Config;
use Piwik\Option;
use Piwik\Plugins\CoreUpdater\UpdateCommunication;
use Piwik\Tests\Framework\Fixture;
use Piwik\UpdateCheck;
use Piwik\Version;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
......@@ -67,33 +68,35 @@ class UpdateCommunicationTest extends IntegrationTestCase
public function test_sendNotifications_shouldSentCorrectEmail()
{
$message = 'ScheduledReports_EmailHello
$rootUrl = Fixture::getTestRootUrl();
$message = "ScheduledReports_EmailHello
CoreUpdater_ThereIsNewVersionAvailableForUpdate
CoreUpdater_YouCanUpgradeAutomaticallyOrDownloadPackage
http://localhost/tests/PHPUnit/proxy/index.php?module=CoreUpdater&action=newVersionAvailable
{$rootUrl}index.php?module=CoreUpdater&action=newVersionAvailable
CoreUpdater_ViewVersionChangelog
http://piwik.org/changelog/piwik-33-0-0/
CoreUpdater_FeedbackRequest
http://piwik.org/contact/';
http://piwik.org/contact/";
$this->assertEmailForVersion('33.0.0', $message);
}
public function test_sendNotifications_shouldNotIncludeChangelogIfNotMajorVersionUpdate()
{
$message = 'ScheduledReports_EmailHello
$rootUrl = Fixture::getTestRootUrl();
$message = "ScheduledReports_EmailHello
CoreUpdater_ThereIsNewVersionAvailableForUpdate
CoreUpdater_YouCanUpgradeAutomaticallyOrDownloadPackage
http://localhost/tests/PHPUnit/proxy/index.php?module=CoreUpdater&action=newVersionAvailable
{$rootUrl}index.php?module=CoreUpdater&action=newVersionAvailable
CoreUpdater_FeedbackRequest
http://piwik.org/contact/';
http://piwik.org/contact/";
$this->assertEmailForVersion('33.0.0-b1', $message);
}
......
......@@ -141,6 +141,11 @@ class Fixture extends \PHPUnit_Framework_Assert
return 'python';
}
public static function getTestRootUrl()
{
return self::getRootUrl() . 'tests/PHPUnit/proxy/';
}
public function loginAsSuperUser()
{
/** @var Auth $auth */
......@@ -277,7 +282,7 @@ class Fixture extends \PHPUnit_Framework_Assert
APILanguageManager::getInstance()->setLanguageForUser('superUserLogin', 'en');
}
SettingsPiwik::overwritePiwikUrl(self::getRootUrl() . 'tests/PHPUnit/proxy/');
SettingsPiwik::overwritePiwikUrl(self::getTestRootUrl());
if ($setupEnvironmentOnly) {
return;
......@@ -513,7 +518,7 @@ class Fixture extends \PHPUnit_Framework_Assert
*/
public static function getTrackerUrl()
{
return self::getRootUrl() . 'tests/PHPUnit/proxy/piwik.php';
return self::getTestRootUrl() . 'piwik.php';
}
/**
......@@ -820,7 +825,7 @@ class Fixture extends \PHPUnit_Framework_Assert
$cmd = $python
. ' "' . PIWIK_INCLUDE_PATH . '/misc/log-analytics/import_logs.py" ' # script loc
. '-ddd ' // debug
. '--url="' . self::getRootUrl() . 'tests/PHPUnit/proxy/" ' # proxy so that piwik uses test config files
. '--url="' . self::getTestRootUrl() . '" ' # proxy so that piwik uses test config files
;
foreach ($options as $name => $values) {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter