Example #1
0
 /**
  * @param $requestUrl
  * @return string
  * @throws Exception
  */
 protected function getResponseFromHttpAPI($requestUrl)
 {
     $queryString = Url::getQueryStringFromParameters($requestUrl);
     $hostAndPath = Fixture::getTestRootUrl();
     $url = $hostAndPath . '?' . $queryString;
     $response = Http::sendHttpRequest($url, $timeout = 300);
     return $response;
 }
 public function test_sendNotifications_shouldNotIncludeChangelogIfNotMajorVersionUpdate()
 {
     $rootUrl = Fixture::getTestRootUrl();
     $message = "ScheduledReports_EmailHello\n\nCoreUpdater_ThereIsNewVersionAvailableForUpdate\n\nCoreUpdater_YouCanUpgradeAutomaticallyOrDownloadPackage\n{$rootUrl}index.php?module=CoreUpdater&action=newVersionAvailable\n\nCoreUpdater_FeedbackRequest\nhttp://piwik.org/contact/";
     $this->assertEmailForVersion('33.0.0-b1', $message);
 }
 public function test_sendNotificationIfUpdatesAvailable_ShouldSendCorrectText()
 {
     $subject = 'CoreUpdater_NotificationSubjectAvailablePluginUpdate';
     $rootUrl = Fixture::getTestRootUrl();
     $message = "ScheduledReports_EmailHello\n\nCoreUpdater_ThereIsNewPluginVersionAvailableForUpdate\n\n * MyTest1 33.0.0\n * MyTest2 32.0.0\n * MyTest3 31.0.0\n\nCoreUpdater_NotificationClickToUpdatePlugins\n{$rootUrl}index.php?module=CorePluginsAdmin&action=plugins\n\nInstallation_HappyAnalysing";
     $mock = $this->getCommunicationMockHavingManyUpdates();
     $mock->expects($this->once())->method('sendEmailNotification')->with($this->equalTo($subject), $this->equalTo($message));
     $mock->sendNotificationIfUpdatesAvailable();
 }