From 0003030076c1a5a94f6cba0ebb94f5a1b63ea1ea Mon Sep 17 00:00:00 2001
From: mattab <matthieu.aubry@gmail.com>
Date: Tue, 11 Feb 2014 17:14:11 +1300
Subject: [PATCH] Refs #4503 adding test cases showing the missing feature /
 exception message

---
 .../EcommerceOrderWithItemsTest.php            | 18 ++++++++++++++++++
 ...nvertedGoal__Goals.getItemsCategory_day.xml |  6 ++++++
 ...asConvertedGoal__Goals.getItemsName_day.xml |  6 ++++++
 ...HasConvertedGoal__Goals.getItemsSku_day.xml |  6 ++++++
 ...vertedGoal1__Goals.getItemsCategory_day.xml |  6 ++++++
 ...tConvertedGoal1__Goals.getItemsName_day.xml |  6 ++++++
 ...otConvertedGoal1__Goals.getItemsSku_day.xml |  6 ++++++
 7 files changed, 54 insertions(+)
 create mode 100644 tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsCategory_day.xml
 create mode 100644 tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsName_day.xml
 create mode 100644 tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsSku_day.xml
 create mode 100644 tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotConvertedGoal1__Goals.getItemsCategory_day.xml
 create mode 100644 tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotConvertedGoal1__Goals.getItemsName_day.xml
 create mode 100644 tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotConvertedGoal1__Goals.getItemsSku_day.xml

diff --git a/tests/PHPUnit/Integration/EcommerceOrderWithItemsTest.php b/tests/PHPUnit/Integration/EcommerceOrderWithItemsTest.php
index 012849f422..5f15fb484b 100755
--- a/tests/PHPUnit/Integration/EcommerceOrderWithItemsTest.php
+++ b/tests/PHPUnit/Integration/EcommerceOrderWithItemsTest.php
@@ -55,6 +55,7 @@ class Test_Piwik_Integration_EcommerceOrderWithItems extends IntegrationTestCase
         );
 
         // Normal standard goal
+        $apiWithSegments_visitConvertedGoal = $apiWithSegments + array('Goals.get', 'VisitsSummary.get');
         return array_merge(array(
 
                 // Segment: This will match the first visit of the fixture only
@@ -181,6 +182,23 @@ class Test_Piwik_Integration_EcommerceOrderWithItems extends IntegrationTestCase
                                                  'periods'    => array('week'), 'segment' => 'visitorType==returningCustomer',
                                                  'testSuffix' => '_SegmentReturningCustomers')),
 
+                // test segment visitConvertedGoalId with Ecommerce APIs
+                array($apiWithSegments_visitConvertedGoal,
+                      array(
+                          'idSite' => $idSite,
+                          'date' => $dateTime,
+                          'periods' => array('day'),
+                          'segment' => 'visitConvertedGoalId==1;visitConvertedGoalId!=2',
+                          'testSuffix' => '_SegmentVisitHasConvertedGoal')),
+
+                array($apiWithSegments_visitConvertedGoal,
+                      array(
+                          'idSite' => $idSite,
+                          'date' => $dateTime,
+                          'periods' => array('day'),
+                          'segment' => 'visitConvertedGoalId!=1',
+                          'testSuffix' => '_SegmentVisitHasNotConvertedGoal1')),
+
                 // test segment pageTitle
                 array('VisitsSummary.get', array('idSite'     => $idSite, 'date' => $dateTime,
                                                  'periods'    => array('day'), 'segment' => 'pageTitle==incredible title!',
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsCategory_day.xml b/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsCategory_day.xml
new file mode 100644
index 0000000000..e730ed6fc4
--- /dev/null
+++ b/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsCategory_day.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+	<error message="Table 'log_conversion' can't be joined for segmentation
+ 
+ --&gt; To temporarily debug this error further, set const DISPLAY_BACKTRACE_DEBUG=true; in ResponseBuilder.php" />
+</result>
\ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsName_day.xml b/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsName_day.xml
new file mode 100644
index 0000000000..e730ed6fc4
--- /dev/null
+++ b/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsName_day.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+	<error message="Table 'log_conversion' can't be joined for segmentation
+ 
+ --&gt; To temporarily debug this error further, set const DISPLAY_BACKTRACE_DEBUG=true; in ResponseBuilder.php" />
+</result>
\ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsSku_day.xml b/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsSku_day.xml
new file mode 100644
index 0000000000..e730ed6fc4
--- /dev/null
+++ b/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasConvertedGoal__Goals.getItemsSku_day.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+	<error message="Table 'log_conversion' can't be joined for segmentation
+ 
+ --&gt; To temporarily debug this error further, set const DISPLAY_BACKTRACE_DEBUG=true; in ResponseBuilder.php" />
+</result>
\ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotConvertedGoal1__Goals.getItemsCategory_day.xml b/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotConvertedGoal1__Goals.getItemsCategory_day.xml
new file mode 100644
index 0000000000..e730ed6fc4
--- /dev/null
+++ b/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotConvertedGoal1__Goals.getItemsCategory_day.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+	<error message="Table 'log_conversion' can't be joined for segmentation
+ 
+ --&gt; To temporarily debug this error further, set const DISPLAY_BACKTRACE_DEBUG=true; in ResponseBuilder.php" />
+</result>
\ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotConvertedGoal1__Goals.getItemsName_day.xml b/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotConvertedGoal1__Goals.getItemsName_day.xml
new file mode 100644
index 0000000000..e730ed6fc4
--- /dev/null
+++ b/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotConvertedGoal1__Goals.getItemsName_day.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+	<error message="Table 'log_conversion' can't be joined for segmentation
+ 
+ --&gt; To temporarily debug this error further, set const DISPLAY_BACKTRACE_DEBUG=true; in ResponseBuilder.php" />
+</result>
\ No newline at end of file
diff --git a/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotConvertedGoal1__Goals.getItemsSku_day.xml b/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotConvertedGoal1__Goals.getItemsSku_day.xml
new file mode 100644
index 0000000000..e730ed6fc4
--- /dev/null
+++ b/tests/PHPUnit/Integration/expected/test_ecommerceOrderWithItems_SegmentVisitHasNotConvertedGoal1__Goals.getItemsSku_day.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+	<error message="Table 'log_conversion' can't be joined for segmentation
+ 
+ --&gt; To temporarily debug this error further, set const DISPLAY_BACKTRACE_DEBUG=true; in ResponseBuilder.php" />
+</result>
\ No newline at end of file
-- 
GitLab