From 47349b085387529e179fc47b720ded0eade5a6f9 Mon Sep 17 00:00:00 2001 From: sgiehl Date: Mon, 4 Jan 2016 21:12:16 +0100 Subject: [PATCH] fixed tests --- plugins/Goals/tests/Integration/APITest.php | 15 ++++++++------- .../expected/test_ImportLogs__Goals.getGoals.xml | 1 + .../test_OneVisitorTwoVisits__Goals.getGoals.xml | 2 ++ ...woVisits_withCookieSupport__Goals.getGoals.xml | 2 ++ .../UIIntegrationTest_api_listing.png | 4 ++-- .../UIIntegrationTest_goals_manage.png | 4 ++-- tests/resources/OmniFixture-dump.sql | 3 ++- 7 files changed, 19 insertions(+), 12 deletions(-) diff --git a/plugins/Goals/tests/Integration/APITest.php b/plugins/Goals/tests/Integration/APITest.php index b2a1d60e986..ee763c40a7b 100644 --- a/plugins/Goals/tests/Integration/APITest.php +++ b/plugins/Goals/tests/Integration/APITest.php @@ -50,23 +50,23 @@ public function test_addGoal_shouldReturnGoalId_IfCreationIsSuccessful() public function test_addGoal_shouldSucceed_IfOnlyMinimumFieldsGiven() { - $idGoal = $this->api->addGoal($this->idSite, 'MyName', 'url', 'http://www.test.de/?pk_campaign=1', 'exact'); + $idGoal = $this->api->addGoal($this->idSite, 'MyName', 'url', 'http://www.test.de/?pk_campaign=1', 'exact', false, false, false, 'test description'); - $this->assertGoal($idGoal, 'MyName', 'url', 'http://www.test.de/?pk_campaign=1', 'exact', 0, 0, 0); + $this->assertGoal($idGoal, 'MyName', 'test description', 'url', 'http://www.test.de/?pk_campaign=1', 'exact', 0, 0, 0); } public function test_addGoal_ShouldSucceed_IfAllFieldsGiven() { $idGoal = $this->api->addGoal($this->idSite, 'MyName', 'url', 'http://www.test.de', 'exact', true, 50, true); - $this->assertGoal($idGoal, 'MyName', 'url', 'http://www.test.de', 'exact', 1, 50, 1); + $this->assertGoal($idGoal, 'MyName', '', 'url', 'http://www.test.de', 'exact', 1, 50, 1); } public function test_addGoal_ShouldSucceed_IfExactPageTitle() { $idGoal = $this->api->addGoal($this->idSite, 'MyName', 'title', 'normal title', 'exact', true, 50, true); - $this->assertGoal($idGoal, 'MyName', 'title', 'normal title', 'exact', 1, 50, 1); + $this->assertGoal($idGoal, 'MyName', '', 'title', 'normal title', 'exact', 1, 50, 1); } /** @@ -143,7 +143,7 @@ public function test_updateGoal_shouldUpdateAllGivenFields() $idGoal = $this->createAnyGoal(); $this->api->updateGoal($this->idSite, $idGoal, 'UpdatedName', 'file', 'http://www.updatetest.de', 'contains', true, 999, true); - $this->assertGoal($idGoal, 'UpdatedName', 'file', 'http://www.updatetest.de', 'contains', 1, 999, 1); + $this->assertGoal($idGoal, 'UpdatedName', '', 'file', 'http://www.updatetest.de', 'contains', 1, 999, 1); } public function test_updateGoal_shouldUpdateMinimalFields_ShouldLeaveOtherFieldsUntouched() @@ -151,7 +151,7 @@ public function test_updateGoal_shouldUpdateMinimalFields_ShouldLeaveOtherFields $idGoal = $this->createAnyGoal(); $this->api->updateGoal($this->idSite, $idGoal, 'UpdatedName', 'file', 'http://www.updatetest.de', 'contains'); - $this->assertGoal($idGoal, 'UpdatedName', 'file', 'http://www.updatetest.de', 'contains', 0, 0, 0); + $this->assertGoal($idGoal, 'UpdatedName', '', 'file', 'http://www.updatetest.de', 'contains', 0, 0, 0); } public function test_deleteGoal_shouldNotDeleteAGoal_IfGoalIdDoesNotExist() @@ -235,12 +235,13 @@ private function assertHasNoGoals() $this->assertEmpty($goals); } - private function assertGoal($idGoal, $name, $url, $pattern, $patternType, $caseSenstive = 0, $revenue = 0, $allowMultiple = 0) + private function assertGoal($idGoal, $name, $description, $url, $pattern, $patternType, $caseSenstive = 0, $revenue = 0, $allowMultiple = 0) { $expected = array($idGoal => array( 'idsite' => $this->idSite, 'idgoal' => $idGoal, 'name' => $name, + 'description' => $description, 'match_attribute' => $url, 'pattern' => $pattern, 'pattern_type' => $patternType, diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__Goals.getGoals.xml b/tests/PHPUnit/System/expected/test_ImportLogs__Goals.getGoals.xml index b33fbbd767a..ae84c83be9c 100644 --- a/tests/PHPUnit/System/expected/test_ImportLogs__Goals.getGoals.xml +++ b/tests/PHPUnit/System/expected/test_ImportLogs__Goals.getGoals.xml @@ -4,6 +4,7 @@ 1 1 all + url http contains diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getGoals.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getGoals.xml index c9cc82f044a..d76dfc3cf81 100644 --- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getGoals.xml +++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__Goals.getGoals.xml @@ -4,6 +4,7 @@ 1 1 triggered js + manually 0 0 @@ -13,6 +14,7 @@ 1 2 matching purchase.htm + url (.*)store\/purchase\.(.*) regex diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getGoals.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getGoals.xml index c9cc82f044a..d76dfc3cf81 100644 --- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getGoals.xml +++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits_withCookieSupport__Goals.getGoals.xml @@ -4,6 +4,7 @@ 1 1 triggered js + manually 0 0 @@ -13,6 +14,7 @@ 1 2 matching purchase.htm + url (.*)store\/purchase\.(.*) regex diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_api_listing.png b/tests/UI/expected-screenshots/UIIntegrationTest_api_listing.png index 5371d389558..9eafa608c84 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_api_listing.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_api_listing.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6f20a599fb5af4ad609a24fac71e78a073c851b82af3f3e918a3552b09017350 -size 4094318 +oid sha256:f01f2c280b0aca85280f969cbb99e850f23806554fe8698f85863fc9294161bc +size 4095615 diff --git a/tests/UI/expected-screenshots/UIIntegrationTest_goals_manage.png b/tests/UI/expected-screenshots/UIIntegrationTest_goals_manage.png index e18256fbe8f..aed4c282212 100644 --- a/tests/UI/expected-screenshots/UIIntegrationTest_goals_manage.png +++ b/tests/UI/expected-screenshots/UIIntegrationTest_goals_manage.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:daa0b9ea1bdf5ac93464cef46bba01a86bd4282f69e5af5069725e07970fded6 -size 50169 +oid sha256:c0f18348319d002742aed335fc06b07bdbe3c76819268b9102d52c2d5e2b0206 +size 54288 diff --git a/tests/resources/OmniFixture-dump.sql b/tests/resources/OmniFixture-dump.sql index 1f7542fcbba..350c46c1d1a 100644 --- a/tests/resources/OmniFixture-dump.sql +++ b/tests/resources/OmniFixture-dump.sql @@ -179,6 +179,7 @@ CREATE TABLE `goal` ( `idsite` int(11) NOT NULL, `idgoal` int(11) NOT NULL, `name` varchar(50) NOT NULL, + `description` VARCHAR(255) NOT NULL DEFAULT '', `match_attribute` varchar(20) NOT NULL, `pattern` varchar(255) NOT NULL, `pattern_type` varchar(10) NOT NULL, @@ -196,7 +197,7 @@ CREATE TABLE `goal` ( LOCK TABLES `goal` WRITE; /*!40000 ALTER TABLE `goal` DISABLE KEYS */; -INSERT INTO `goal` VALUES (1,1,'','url','http','contains',0,1,5,0),(1,2,'two','url','xxxxxxxxxxxxx','contains',0,0,5,0),(1,3,'click event','event_action','click','contains',0,0,0,0),(1,4,'category event','event_category','The_Category','exact',1,0,0,0),(1,5,'name event','event_name','','exact',0,0,0,0); +INSERT INTO `goal` VALUES (1,1,'','','url','http','contains',0,1,5,0),(1,2,'two','twodesc','url','xxxxxxxxxxxxx','contains',0,0,5,0),(1,3,'click event','','event_action','click','contains',0,0,0,0),(1,4,'category event','categorydesc','event_category','The_Category','exact',1,0,0,0),(1,5,'name event','eventdesc','event_name','','exact',0,0,0,0); /*!40000 ALTER TABLE `goal` ENABLE KEYS */; UNLOCK TABLES;