diff --git a/plugins/CoreConsole/Commands/TestsRun.php b/plugins/CoreConsole/Commands/TestsRun.php index 542e803b9e25caff6264240b07a613af618fd157..5f940acb835f22b7ed660b9544fda1eb08da4a10 100644 --- a/plugins/CoreConsole/Commands/TestsRun.php +++ b/plugins/CoreConsole/Commands/TestsRun.php @@ -87,7 +87,7 @@ class TestsRun extends ConsoleCommand private function executeTestFile($testFile, $options, $command, OutputInterface $output) { - $params = $testFile . " " . $options; + $params = $options . " " . $testFile; $cmd = sprintf("cd %s/tests/PHPUnit && %s %s", PIWIK_DOCUMENT_ROOT, $command, $params); $output->writeln('Executing command: <info>' . $cmd . '</info>'); passthru($cmd); diff --git a/tests/PHPUnit/Core/API/ApiRendererTest.php b/tests/PHPUnit/Core/API/ApiRendererTest.php index 42d014ae175d43d8d64e4ea826ba90f734a95232..ebe1952a908c7f58e79caf33c207c254e8aab752 100644 --- a/tests/PHPUnit/Core/API/ApiRendererTest.php +++ b/tests/PHPUnit/Core/API/ApiRendererTest.php @@ -10,6 +10,7 @@ use Piwik\API\ApiRenderer; /** * @group Core + * @group Only2 */ class ApiRendererTest extends PHPUnit_Framework_TestCase { diff --git a/tests/PHPUnit/Core/DataTable/Filter/PivotByDimensionTest.php b/tests/PHPUnit/Core/DataTable/Filter/PivotByDimensionTest.php index f1de402f44ee664a94797bf362b732c49f4899bb..80162b362f9efce5287284a7b5c9cf2ab5d2050e 100644 --- a/tests/PHPUnit/Core/DataTable/Filter/PivotByDimensionTest.php +++ b/tests/PHPUnit/Core/DataTable/Filter/PivotByDimensionTest.php @@ -70,7 +70,7 @@ class PivotByDimensionTest extends PHPUnit_Framework_TestCase * @expectedException Exception * @expectedExceptionMessage Unsupported pivot: report 'ExampleReport.ExampleReportName' has no subtable dimension. */ - public function testConstructionFailsWhenReportHasNoSubtableAndSegmentFetchingIsDisabled() + public function test_construction_ShouldFail_WhenReportHasNoSubtableAndSegmentFetchingIsDisabled() { $this->loadPlugins('ExampleReport', 'UserCountry'); @@ -81,7 +81,7 @@ class PivotByDimensionTest extends PHPUnit_Framework_TestCase * @expectedException Exception * @expectedExceptionMessage Unsupported pivot: the subtable dimension for 'Referrers.Referrers_Keywords' does not match the requested pivotBy dimension. */ - public function testConstructionFailsWhenDimensionIsNotSubtableAndSegmentFetchingIsDisabled() + public function test_construction_ShouldFail_WhenDimensionIsNotSubtableAndSegmentFetchingIsDisabled() { $this->loadPlugins('Referrers', 'UserCountry'); @@ -92,7 +92,7 @@ class PivotByDimensionTest extends PHPUnit_Framework_TestCase * @expectedException Exception * @expectedExceptionMessage Unsupported pivot: No segment for dimension of report 'UserSettings.UserSettings_WidgetBrowserFamilies' */ - public function testConstructionFailsWhenDimensionIsNotSubtableAndSegmentFetchingIsEnabledButThereIsNoSegment() + public function test_construction_ShouldFail_WhenDimensionIsNotSubtableAndSegmentFetchingIsEnabledButThereIsNoSegment() { $this->loadPlugins('Referrers', 'UserSettings'); @@ -103,7 +103,7 @@ class PivotByDimensionTest extends PHPUnit_Framework_TestCase * @expectedException Exception * @expectedExceptionMessage Invalid dimension 'ExampleTracker.InvalidDimension' */ - public function testConstructionFailsWhenDimensionDoesNotExist() + public function test_construction_ShouldFail_WhenDimensionDoesNotExist() { $this->loadPlugins('ExampleReport', 'ExampleTracker'); @@ -114,7 +114,7 @@ class PivotByDimensionTest extends PHPUnit_Framework_TestCase * @expectedException Exception * @expectedExceptionMessage Unsupported pivot: No report for pivot dimension 'ExampleTracker.ExampleDimension' */ - public function testConstructionFailsWhenThereIsNoReportForADimension() + public function test_construction_ShouldFail_WhenThereIsNoReportForADimension() { $this->loadPlugins('ExampleReport', 'ExampleTracker'); @@ -125,14 +125,14 @@ class PivotByDimensionTest extends PHPUnit_Framework_TestCase * @expectedException Exception * @expectedExceptionMessage Unable to find report 'ExampleReport.InvalidReport' */ - public function testConstructionFailsWhenSpecifiedReportIsNotValid() + public function test_construction_ShouldFail_WhenSpecifiedReportIsNotValid() { $this->loadPlugins('ExampleReport', 'Referrers'); new PivotByDimension(new DataTable(), "ExampleReport.InvalidReport", "Referrers.Keyword", "nb_visits"); } - public function testFilterReturnsEmptyResultWhenTableToFilterIsEmpty() + public function test_filter_ReturnsEmptyResult_WhenTableToFilterIsEmpty() { $this->loadPlugins('Referrers', 'UserCountry', 'CustomVariables'); @@ -144,7 +144,7 @@ class PivotByDimensionTest extends PHPUnit_Framework_TestCase $this->assertEquals(array(), $table->getRows()); } - public function testFilterCorrectlyCreatesPivotTableUsingSubtableReport() + public function test_filter_CorrectlyCreatesPivotTable_WhenUsingSubtableReport() { $this->loadPlugins('Referrers', 'UserCountry', 'CustomVariables'); @@ -161,7 +161,7 @@ class PivotByDimensionTest extends PHPUnit_Framework_TestCase $this->assertTableRowsEquals($expectedRows, $table); } - public function testFilterCorrectlyCreatesPivotTableUsingSegment() + public function test_filter_CorrectlyCreatesPivotTable_WhenUsingSegment() { $this->loadPlugins('Referrers', 'UserCountry', 'CustomVariables'); @@ -181,7 +181,7 @@ class PivotByDimensionTest extends PHPUnit_Framework_TestCase $this->assertTableRowsEquals($expectedRows, $table); } - public function testFilterUsesCorrectSegmentWhenPivotingSegmentedReport() + public function test_filter_UsesCorrectSegment_WhenPivotingSegmentedReport() { $this->loadPlugins('Referrers', 'UserCountry', 'CustomVariables'); @@ -200,7 +200,7 @@ class PivotByDimensionTest extends PHPUnit_Framework_TestCase $this->assertEquals($expectedSegmentParams, $this->segmentUsedToGetIntersected); } - public function testFilterCorrectlyCreatesPivotTableWhenPivotMetricDoesNotExistInTable() + public function test_filter_CorrectlyCreatesPivotTable_WhenPivotMetricDoesNotExistInTable() { $this->loadPlugins('Referrers', 'UserCountry', 'CustomVariables'); @@ -217,7 +217,7 @@ class PivotByDimensionTest extends PHPUnit_Framework_TestCase $this->assertTableRowsEquals($expectedRows, $table); } - public function testFilterCorrectlyCreatesPivotTableWhenSubtablesHaveNoRows() + public function test_filter_CorrectlyCreatesPivotTable_WhenSubtablesHaveNoRows() { $this->loadPlugins('Referrers', 'UserCountry', 'CustomVariables'); @@ -235,7 +235,7 @@ class PivotByDimensionTest extends PHPUnit_Framework_TestCase $this->assertTableRowsEquals($expectedRows, $table); } - public function testFilterCorrectlyDefaultsPivotByColumnWhenNoneProvided() + public function test_filter_CorrectlyDefaultsPivotByColumn_WhenNoneProvided() { $this->loadPlugins('Referrers', 'UserCountry', 'CustomVariables'); @@ -252,7 +252,7 @@ class PivotByDimensionTest extends PHPUnit_Framework_TestCase $this->assertTableRowsEquals($expectedRows, $table); } - public function testFilterCorrectlyLimitsTheColumnNumberWhenColumnLimitProvided() + public function test_filter_CorrectlyLimitsTheColumnNumber_WhenColumnLimitProvided() { $this->loadPlugins('Referrers', 'UserCountry', 'CustomVariables'); diff --git a/tests/PHPUnit/Integration/PivotByQueryParamTest.php b/tests/PHPUnit/Integration/PivotByQueryParamTest.php index d798d22bea3bfa8a461b94b46df2e9c776480a0f..6d42fe51ba15c6a78e6a80196f9fe0082736d618 100644 --- a/tests/PHPUnit/Integration/PivotByQueryParamTest.php +++ b/tests/PHPUnit/Integration/PivotByQueryParamTest.php @@ -30,7 +30,7 @@ class PivotByQueryParamTest extends IntegrationTestCase Config::getInstance()->General['pivot_by_filter_enable_fetch_by_segment'] = 1; } - public function testPivotBySubtableDimensionCreatesCorrectPivotTable() + public function test_PivotBySubtableDimension_CreatesCorrectPivotTable() { $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array( 'idSite' => self::$fixture->idSite, @@ -43,7 +43,7 @@ class PivotByQueryParamTest extends IntegrationTestCase )); } - public function testPivotBySubtableDimensionCreatesCorrectPivotTableWhenEntireHirearchyIsNotLoaded() + public function test_PivotBySubtableDimension_CreatesCorrectPivotTable_WhenEntireHirearchyIsNotLoaded() { $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array( 'idSite' => self::$fixture->idSite, @@ -56,7 +56,7 @@ class PivotByQueryParamTest extends IntegrationTestCase )); } - public function testPivotBySegmentCreatesCorrectPivotTable() + public function test_PivotBySegment_CreatesCorrectPivotTable() { $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array( 'idSite' => self::$fixture->idSite, @@ -68,7 +68,7 @@ class PivotByQueryParamTest extends IntegrationTestCase )); } - public function testPivotBySegmentCreatesCorrectPivotTableWhenSegmentUsedInRequest() + public function test_PivotBySegment_CreatesCorrectPivotTable_WhenSegmentUsedInRequest() { $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array( 'idSite' => self::$fixture->idSite, @@ -81,7 +81,7 @@ class PivotByQueryParamTest extends IntegrationTestCase )); } - public function testPivotByParamPlaysNiceWithOtherQueryParams() + public function test_PivotByParam_PlaysNiceWithOtherQueryParams() { $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array( 'idSite' => self::$fixture->idSite, @@ -98,7 +98,7 @@ class PivotByQueryParamTest extends IntegrationTestCase )); } - public function testPivotByParamPlaysNiceWithQueuedFilters() + public function test_PivotByParam_PlaysNiceWithQueuedFilters() { // TODO: known issue: some segment/report relationships are more complicated; for example, UserCountry.GetCity labels are combinations // of city, region & country dimensions, so the segment to get an intersected table needs all 3 of those. @@ -115,7 +115,7 @@ class PivotByQueryParamTest extends IntegrationTestCase )); } - public function testPivotByParamWorksWithReportWhoseSubtableIsSelf() + public function test_PivotByParam_WorksWithReportWhoseSubtableIsSelf() { $this->assertApiResponseEqualsExpected("Actions.getPageUrls", array( 'idSite' => self::$fixture->idSite, @@ -127,7 +127,7 @@ class PivotByQueryParamTest extends IntegrationTestCase )); } - public function testPivotByParamWorksWithColumnLimiting() + public function test_PivotByParam_WorksWithColumnLimiting() { $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array( 'idSite' => self::$fixture->idSite, @@ -139,7 +139,7 @@ class PivotByQueryParamTest extends IntegrationTestCase )); } - public function testPivotByParamWorksWithJsonOutput() + public function test_PivotByParam_WorksWithJsonOutput() { $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array( 'idSite' => self::$fixture->idSite, @@ -152,7 +152,7 @@ class PivotByQueryParamTest extends IntegrationTestCase )); } - public function testPivotByParamWorksWithCsvOutput() + public function test_PivotByParam_WorksWithCsvOutput() { $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array( 'idSite' => self::$fixture->idSite, @@ -165,7 +165,7 @@ class PivotByQueryParamTest extends IntegrationTestCase )); } - public function testPivotByParamPlaysNiceWithDataTableMaps() + public function test_PivotByParam_PlaysNiceWithDataTableMaps() { $this->assertApiResponseEqualsExpected("Referrers.getKeywords", array( 'idSite' => 'all', diff --git a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_testPivotByParamPlaysNiceWithDataTableMaps__Referrers.getKeywords_day.xml b/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_PlaysNiceWithDataTableMaps__Referrers.getKeywords_day.xml similarity index 100% rename from tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_testPivotByParamPlaysNiceWithDataTableMaps__Referrers.getKeywords_day.xml rename to tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_PlaysNiceWithDataTableMaps__Referrers.getKeywords_day.xml diff --git a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_testPivotByParamPlaysNiceWithOtherQueryParams__Referrers.getKeywords_week.xml b/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_PlaysNiceWithOtherQueryParams__Referrers.getKeywords_week.xml similarity index 100% rename from tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_testPivotByParamPlaysNiceWithOtherQueryParams__Referrers.getKeywords_week.xml rename to tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_PlaysNiceWithOtherQueryParams__Referrers.getKeywords_week.xml diff --git a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_testPivotByParamWorksWithColumnLimiting__Referrers.getKeywords_week.xml b/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithColumnLimiting__Referrers.getKeywords_week.xml similarity index 100% rename from tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_testPivotByParamWorksWithColumnLimiting__Referrers.getKeywords_week.xml rename to tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithColumnLimiting__Referrers.getKeywords_week.xml diff --git a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_testPivotByParamWorksWithCsvOutput__Referrers.getKeywords_week.csv b/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithCsvOutput__Referrers.getKeywords_week.csv similarity index 100% rename from tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_testPivotByParamWorksWithCsvOutput__Referrers.getKeywords_week.csv rename to tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithCsvOutput__Referrers.getKeywords_week.csv diff --git a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_testPivotByParamWorksWithJsonOutput__Referrers.getKeywords_week.json b/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithJsonOutput__Referrers.getKeywords_week.json similarity index 100% rename from tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_testPivotByParamWorksWithJsonOutput__Referrers.getKeywords_week.json rename to tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithJsonOutput__Referrers.getKeywords_week.json diff --git a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_testPivotByParamWorksWithReportWhoseSubtableIsSelf__Actions.getPageUrls_week.xml b/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithReportWhoseSubtableIsSelf__Actions.getPageUrls_week.xml similarity index 100% rename from tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_testPivotByParamWorksWithReportWhoseSubtableIsSelf__Actions.getPageUrls_week.xml rename to tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotByParam_WorksWithReportWhoseSubtableIsSelf__Actions.getPageUrls_week.xml diff --git a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_testPivotBySegmentCreatesCorrectPivotTableWhenSegmentUsedInRequest__Referrers.getKeywords_week.xml b/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotBySegment_CreatesCorrectPivotTable_WhenSegmentUsedInRequest__Referrers.getKeywords_week.xml similarity index 100% rename from tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_testPivotBySegmentCreatesCorrectPivotTableWhenSegmentUsedInRequest__Referrers.getKeywords_week.xml rename to tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotBySegment_CreatesCorrectPivotTable_WhenSegmentUsedInRequest__Referrers.getKeywords_week.xml diff --git a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_testPivotBySegmentCreatesCorrectPivotTable__Referrers.getKeywords_week.xml b/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotBySegment_CreatesCorrectPivotTable__Referrers.getKeywords_week.xml similarity index 100% rename from tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_testPivotBySegmentCreatesCorrectPivotTable__Referrers.getKeywords_week.xml rename to tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotBySegment_CreatesCorrectPivotTable__Referrers.getKeywords_week.xml diff --git a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_testPivotBySubtableDimensionCreatesCorrectPivotTableWhenEntireHirearchyIsNotLoaded__Referrers.getKeywords_week.xml b/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotBySubtableDimension_CreatesCorrectPivotTable_WhenEntireHirearchyIsNotLoaded__Referrers.getKeywords_week.xml similarity index 100% rename from tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_testPivotBySubtableDimensionCreatesCorrectPivotTableWhenEntireHirearchyIsNotLoaded__Referrers.getKeywords_week.xml rename to tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotBySubtableDimension_CreatesCorrectPivotTable_WhenEntireHirearchyIsNotLoaded__Referrers.getKeywords_week.xml diff --git a/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_testPivotBySubtableDimensionCreatesCorrectPivotTable__Referrers.getKeywords_week.xml b/tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotBySubtableDimension_CreatesCorrectPivotTable__Referrers.getKeywords_week.xml similarity index 100% rename from tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_testPivotBySubtableDimensionCreatesCorrectPivotTable__Referrers.getKeywords_week.xml rename to tests/PHPUnit/Integration/expected/test_PivotByQueryParamTest_test_PivotBySubtableDimension_CreatesCorrectPivotTable__Referrers.getKeywords_week.xml