diff options
author | Kate Butler <kate@innocraft.com> | 2019-09-16 23:50:03 +0300 |
---|---|---|
committer | Thomas Steur <tsteur@users.noreply.github.com> | 2019-09-16 23:50:03 +0300 |
commit | 9f767b4f069adafbcddef2f4cf6c5a4a8333f68b (patch) | |
tree | 86c3c1cfedd89858b3d102f8f59cb14d19614d82 /plugins/CoreAdminHome/tests | |
parent | 5bb2cdaab831831f0e927de7857937230ca15b30 (diff) |
Tweak behaviour of orphaned segment archive purge (#14857)
Diffstat (limited to 'plugins/CoreAdminHome/tests')
-rw-r--r-- | plugins/CoreAdminHome/tests/Integration/TasksTest.php | 127 |
1 files changed, 0 insertions, 127 deletions
diff --git a/plugins/CoreAdminHome/tests/Integration/TasksTest.php b/plugins/CoreAdminHome/tests/Integration/TasksTest.php index 830da7ef97..a23d368de4 100644 --- a/plugins/CoreAdminHome/tests/Integration/TasksTest.php +++ b/plugins/CoreAdminHome/tests/Integration/TasksTest.php @@ -219,133 +219,6 @@ class TasksTest extends IntegrationTestCase $this->assertEquals(2, $mail->getNumFailures()); } - public function test_getSegmentHashesByIdSite_emptyWhenNoSegments() - { - $segmentsByIdSite = $this->tasks->getSegmentHashesByIdSite(); - $this->assertEquals(array(), $segmentsByIdSite); - } - - public function test_getSegmentHashesByIdSite_allWebsiteAndSiteSpecificSegments() - { - $model = new Model(); - $model->createSegment(array( - 'name' => 'Test Segment 1', - 'definition' => 'continentCode==eur', - 'enable_only_idsite' => 0, - 'deleted' => 0 - )); - $model->createSegment(array( - 'name' => 'Test Segment 2', - 'definition' => 'countryCode==nz', - 'enable_only_idsite' => 0, - 'deleted' => 0 - )); - $model->createSegment(array( - 'name' => 'Test Segment 3', - 'definition' => 'countryCode==au', - 'enable_only_idsite' => 2, - 'deleted' => 0 - )); - - $segmentsByIdSite = $this->tasks->getSegmentHashesByIdSite(); - $expected = array( - 0 => array('be90051048558489e1d62f4245a6dc65', 'b92fbb3009b32cf632965802de2fb760'), - 2 => array('cffd4336c22c6782211f853495076b1a') - ); - $this->assertEquals($expected, $segmentsByIdSite); - } - - public function test_getSegmentHashesByIdSite_deletedSegment() - { - $model = new Model(); - $model->createSegment(array( - 'name' => 'Test Segment 1', - 'definition' => 'continentCode==eur', - 'enable_only_idsite' => 0, - 'deleted' => 0 - )); - $model->createSegment(array( - 'name' => 'Test Segment 2', - 'definition' => 'countryCode==nz', - 'enable_only_idsite' => 0, - 'deleted' => 1 - )); - $model->createSegment(array( - 'name' => 'Test Segment 3', - 'definition' => 'countryCode==au', - 'enable_only_idsite' => 2, - 'deleted' => 0 - )); - - $segmentsByIdSite = $this->tasks->getSegmentHashesByIdSite(); - $expected = array( - 0 => array('be90051048558489e1d62f4245a6dc65'), - 2 => array('cffd4336c22c6782211f853495076b1a') - ); - $this->assertEquals($expected, $segmentsByIdSite); - } - - public function test_getSegmentHashesByIdSite_invalidSegment() - { - $model = new Model(); - $model->createSegment(array( - 'name' => 'Test Segment 4', - 'definition' => 'countryCode=nz', //The single "=" is invalid - we should generate a hash anyway - 'enable_only_idsite' => 0, - 'deleted' => 0 - )); - $model->createSegment(array( - 'name' => 'Test Segment 5', - 'definition' => 'countryCode==au', - 'enable_only_idsite' => 0, - 'deleted' => 0 - )); - - $expected = array( - 0 => array('5ffe7e116fae7576c047b1fb811584a5', 'cffd4336c22c6782211f853495076b1a'), - ); - - $segmentsByIdSite = $this->tasks->getSegmentHashesByIdSite(); - $this->assertEquals($expected, $segmentsByIdSite); - } - - public function test_getSegmentHashesByIdSite_siteSpecificCustomDimension() - { - // Insert a custom dimension for idsite = 1 - $configuration = new Configuration(); - $configuration->configureNewDimension( - 1, - 'mydimension', - CustomDimensions::SCOPE_VISIT, - 1, - 1, - array(), - true - ); - - $model = new Model(); - $model->createSegment(array( - 'name' => 'Test Segment 6', - 'definition' => 'mydimension==red', - 'enable_only_idsite' => 1, - 'deleted' => 0 - )); - $model->createSegment(array( - 'name' => 'Test Segment 7', - 'definition' => 'countryCode==au', - 'enable_only_idsite' => 2, - 'deleted' => 0 - )); - - $expected = array( - 1 => array('240d2a84a309debd26bdbaa8eb3d363c'), - 2 => array('cffd4336c22c6782211f853495076b1a') - ); - - $segmentsByIdSite = $this->tasks->getSegmentHashesByIdSite(); - $this->assertEquals($expected, $segmentsByIdSite); - } - /** * @param Date[] $dates */ |