Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteur committed Aug 29, 2016
1 parent 4c9d127 commit 903b870
Show file tree
Hide file tree
Showing 37 changed files with 580 additions and 562 deletions.
30 changes: 4 additions & 26 deletions .travis.yml
Expand Up @@ -62,46 +62,24 @@ matrix:
- php: 5.5
env: TEST_SUITE=IntegrationTests MYSQL_ADAPTER=PDO_MYSQL
- php: 5.5
env: TEST_SUITE=AllTests MYSQL_ADAPTER=PDO_MYSQL
- php: 7
env: TEST_SUITE=AllTests MYSQL_ADAPTER=PDO_MYSQL
- php: 5.5
env: TEST_SUITE=UnitTests MYSQL_ADAPTER=PDO_MYSQL
- php: hhvm
env: TEST_SUITE=SystemTests MYSQL_ADAPTER=PDO_MYSQL
- php: hhvm
env: TEST_SUITE=IntegrationTests MYSQL_ADAPTER=PDO_MYSQL
- php: hhvm
env: TEST_SUITE=UnitTests MYSQL_ADAPTER=PDO_MYSQL
# run UI tests on PHP 5.5 only
- php: 5.6
env: TEST_SUITE=UITests MYSQL_ADAPTER=PDO_MYSQL UITEST_EXTRA_OPTIONS="--run-first-half-only"
- php: 5.6
env: TEST_SUITE=UITests MYSQL_ADAPTER=PDO_MYSQL UITEST_EXTRA_OPTIONS="--run-second-half-only"
# run all tests not on PHP 5.6 and run MySQLI tests only on 5.6
- php: 5.6
env: TEST_SUITE=AllTests MYSQL_ADAPTER=PDO_MYSQL
- php: 5.5
env: TEST_SUITE=AllTests MYSQL_ADAPTER=MYSQLI
- php: 7
env: TEST_SUITE=AllTests MYSQL_ADAPTER=MYSQLI
- php: hhvm
env: TEST_SUITE=AllTests MYSQL_ADAPTER=MYSQLI
env: TEST_SUITE=AllTests MYSQL_ADAPTER=MYSQLI ALLTEST_EXTRA_OPTIONS="--run-first-half-only"
- php: 5.5
env: TEST_SUITE=AllTests MYSQL_ADAPTER=MYSQLI ALLTEST_EXTRA_OPTIONS="--run-second-half-only"
# Javascript tests need to run only on one PHP version
- php: 5.5
env: TEST_SUITE=JavascriptTests MYSQL_ADAPTER=PDO_MYSQL
- php: hhvm
env: TEST_SUITE=JavascriptTests MYSQL_ADAPTER=PDO_MYSQL
- php: 7
env: TEST_SUITE=JavascriptTests MYSQL_ADAPTER=PDO_MYSQL
# AngularJS tests need to run only on one PHP version
- php: 5.5
env: TEST_SUITE=AngularJSTests MYSQL_ADAPTER=PDO_MYSQL SKIP_COMPOSER_INSTALL=1
- php: hhvm
env: TEST_SUITE=AngularJSTests MYSQL_ADAPTER=PDO_MYSQL SKIP_COMPOSER_INSTALL=1
- php: 7
env: TEST_SUITE=AngularJSTests MYSQL_ADAPTER=PDO_MYSQL SKIP_COMPOSER_INSTALL=1


sudo: required

script: $PIWIK_ROOT_DIR/tests/travis/travis.sh
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -20,11 +20,11 @@
},
"config":{
"platform": {
"php": "5.3.3"
"php": "5.5.0"
}
},
"require": {
"php": ">=5.3.3",
"php": ">=5.5.0",
"twig/twig": "~1.0",
"leafo/lessphp": "~0.5.0",
"symfony/console": "~2.6.0",
Expand Down
4 changes: 2 additions & 2 deletions core/AssetManager.php
Expand Up @@ -69,12 +69,12 @@ public function __construct()
{
$this->cacheBuster = UIAssetCacheBuster::getInstance();

$this->minimalStylesheetFetcher = new StaticUIAssetFetcher(array(), array(), $this->theme);

$theme = Manager::getInstance()->getThemeEnabled();
if (!empty($theme)) {
$this->theme = new Theme();
}

$this->minimalStylesheetFetcher = new StaticUIAssetFetcher(array(), array(), $this->theme);
}

/**
Expand Down
Expand Up @@ -16,11 +16,7 @@ class StylesheetUIAssetFetcher extends UIAssetFetcher
protected function getPriorityOrder()
{
$theme = $this->getTheme();
if (empty($theme)) {
$themeName = 'Morpheus';
} else {
$themeName = $theme->getThemeName();
}
$themeName = $theme->getThemeName();

$order = array(
'plugins/Morpheus/stylesheets/base/bootstrap.css',
Expand Down
2 changes: 1 addition & 1 deletion plugins/AnonymousPiwikUsageMeasurement
4 changes: 2 additions & 2 deletions plugins/CoreConsole/Commands/GeneratePlugin.php
Expand Up @@ -52,7 +52,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
'ExampleTheme' => $pluginName,
$exampleDescription => $description,
'0.1.0' => $version,
'PIWIK_VERSION' => Version::VERSION
'3.0.0-b1' => Version::VERSION
);
$whitelistFiles = array();

Expand All @@ -63,7 +63,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
'ExamplePlugin' => $pluginName,
$exampleDescription => $description,
'0.1.0' => $version,
'PIWIK_VERSION' => Version::VERSION
'3.0.0-b1' => Version::VERSION
);
$whitelistFiles = array(
'/ExamplePlugin.php',
Expand Down
47 changes: 29 additions & 18 deletions plugins/CoreHome/javascripts/dataTable.js
Expand Up @@ -1673,29 +1673,40 @@ $.extend(DataTable.prototype, UIControl.prototype, {
var tooltip = th.find('.columnDocumentation');

tooltip.next().hover(function () {
var left = (-1 * tooltip.outerWidth() / 2) + th.width() / 2;
var top = -1 * tooltip.outerHeight();
var left = (-1 * tooltip.outerWidth() / 2) + th.width() / 2;
var top = -1 * tooltip.outerHeight();

if (th.next().size() == 0) {
left = (-1 * tooltip.outerWidth()) + th.width() +
parseInt(th.css('padding-right'), 10);
}
var thPos = th.position();
var thPosTop = 0;

if (th.offset().top + top < 0) {
top = th.outerHeight();
}
if (thPos && thPos.top) {
thPosTop = thPosTop.top;
}

tooltip.css({
marginLeft: left,
marginTop: top,
top: 0
});
// we need to add thPosTop because the parent th is not position:relative. There may be a gap for the
// headline
top = top + thPosTop;

tooltip.stop(true, true).fadeIn(250);
},
function () {
$(this).prev().stop(true, true).fadeOut(400);
if (th.next().size() == 0) {
left = (-1 * tooltip.outerWidth()) + th.width() +
parseInt(th.css('padding-right'), 10);
}

if (th.offset().top + top < 0) {
top = thPosTop + th.outerHeight();
}

tooltip.css({
marginLeft: left,
marginTop: top,
top: 0
});

tooltip.stop(true, true).fadeIn(250);
},
function () {
$(this).prev().stop(true, true).fadeOut(400);
});
});
},

Expand Down
2 changes: 1 addition & 1 deletion plugins/CustomAlerts
2 changes: 1 addition & 1 deletion plugins/CustomDimensions
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion plugins/ExamplePlugin/plugin.json
Expand Up @@ -4,7 +4,7 @@
"description": "Piwik Platform showcase: how to create widgets, menus, scheduled tasks, a custom archiver, plugin tests, and a AngularJS component.",
"theme": false,
"require": {
"piwik": ">=PIWIK_VERSION,<3.0.0-b1"
"piwik": ">=3.0.0-b1,<4.0.0-b1"
},
"authors": [
{
Expand Down
2 changes: 1 addition & 1 deletion plugins/ExampleTheme/plugin.json
Expand Up @@ -4,7 +4,7 @@
"version": "0.1.0",
"theme": true,
"require": {
"piwik": ">=PIWIK_VERSION,<3.0.0-b1"
"piwik": ">=3.0.0-b1,<4.0.0-b1"
},
"stylesheet": "stylesheets/theme.less",
"homepage": "",
Expand Down
2 changes: 1 addition & 1 deletion plugins/Installation/ServerFilesGenerator.php
Expand Up @@ -48,7 +48,7 @@ public static function createHtAccessFiles()
"</IfModule>\n\n" .

"# Allow to serve static files which are safe\n" .
"<Files ~ \"\\.(gif|ico|jpg|png|svg|js|css|htm|html|swf|mp3|mp4|wav|ogg|avi|ttf|eot|woff|woff2)$\">\n" .
"<Files ~ \"\\.(gif|ico|jpg|png|svg|js|css|htm|html|swf|mp3|mp4|wav|ogg|avi|ttf|eot|woff|woff2|json)$\">\n" .
$allow . "\n" .
"</Files>\n";

Expand Down
2 changes: 1 addition & 1 deletion plugins/LogViewer
2 changes: 1 addition & 1 deletion plugins/LoginHttpAuth
8 changes: 7 additions & 1 deletion plugins/Morpheus/templates/genericForm.twig
Expand Up @@ -34,5 +34,11 @@
{% endif %}
{% endfor %}

{{ form_data.submit.html|raw }}
{% if form_data.submit.html %}
<div class="row">
<div class="col s12">
{{ form_data.submit.html|raw }}
</div>
</div>
{% endif %}
</form>
49 changes: 0 additions & 49 deletions plugins/PiwikPro/Widgets/RssPiwikPro.php

This file was deleted.

60 changes: 0 additions & 60 deletions plugins/ProfessionalServices/Widgets.php

This file was deleted.

Expand Up @@ -6,16 +6,15 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
namespace Piwik\Plugins\PiwikPro\Widgets;
namespace Piwik\Plugins\ProfessionalServices\Widgets;

use Piwik\Container\StaticContainer;
use Piwik\Piwik;
use Piwik\PiwikPro\Advertising;
use Piwik\Plugins\PiwikPro\Promo;
use Piwik\Plugins\ProfessionalServices\Promo;
use Piwik\ProfessionalServices\Advertising;
use Piwik\View;
use Piwik\Widget\WidgetConfig;

class PromoPiwikPro extends \Piwik\Widget\Widget
class PromoServices extends \Piwik\Widget\Widget
{
/**
* @var Advertising
Expand All @@ -36,17 +35,19 @@ public function __construct(Advertising $advertising, Promo $promo)
public static function configure(WidgetConfig $config)
{
$config->setCategoryId('About Piwik');
$config->setName('PiwikPro_WidgetPiwikProAd');
$config->setIsEnabled(StaticContainer::get('Piwik\PiwikPro\Advertising')->arePiwikProAdsEnabled());
$config->setName('ProfessionalServices_WidgetProfessionalServicesForPiwik');

$advertising = StaticContainer::get('Piwik\ProfessionalServices\Advertising');
$config->setIsEnabled($advertising->areAdsForProfessionalServicesEnabled());
}

public function render()
{
$view = new View('@PiwikPro/promoPiwikProWidget');
$view = new View('@ProfessionalServices/promoServicesWidget');

$promo = $this->promo->getContent();

$view->ctaLinkUrl = $this->advertising->getPromoUrlForOnPremises('PromoWidget', $promo['campaignContent']);
$view->ctaLinkUrl = $this->advertising->getPromoUrlForPiwikProUpgrade();
$view->ctaText = $promo['text'];
$view->ctaLinkTitle = $this->promo->getLinkTitle();

Expand Down

0 comments on commit 903b870

Please sign in to comment.