[MediaWiki-commits] [Gerrit] Add a base test - change (wikimedia...crm)
Ejegg has submitted this change and it was merged. Change subject: Add a base test .. Add a base test Currently, it just strips source data. This should be shared with other import tests. Change-Id: I974878a5bc6c567faa88ca50b379495f61d8e946 --- M sites/all/modules/offline2civicrm/offline2civicrm.info M sites/all/modules/offline2civicrm/tests/AzlChecksFileTest.php M sites/all/modules/offline2civicrm/tests/JpMorganFileTest.php M sites/all/modules/offline2civicrm/tests/PayPalChecksFileTest.php A sites/all/modules/offline2civicrm/tests/includes/BaseChecksFileTest.php 5 files changed, 28 insertions(+), 4 deletions(-) Approvals: Ejegg: Looks good to me, approved diff --git a/sites/all/modules/offline2civicrm/offline2civicrm.info b/sites/all/modules/offline2civicrm/offline2civicrm.info index bf13c7e..39fbef8 100644 --- a/sites/all/modules/offline2civicrm/offline2civicrm.info +++ b/sites/all/modules/offline2civicrm/offline2civicrm.info @@ -17,4 +17,4 @@ files[] = EmptyRowException.php files[] = JpMorganFile.php files[] = PayPalChecksFile.php -files[] = tests/ContributionConversion.test +files[] = tests/includes/BaseChecksFileTest.php diff --git a/sites/all/modules/offline2civicrm/tests/AzlChecksFileTest.php b/sites/all/modules/offline2civicrm/tests/AzlChecksFileTest.php index fb6a650..d2ef986 100644 --- a/sites/all/modules/offline2civicrm/tests/AzlChecksFileTest.php +++ b/sites/all/modules/offline2civicrm/tests/AzlChecksFileTest.php @@ -1,6 +1,6 @@ _parseRow( $data ); +$this->stripSourceData( $output ); $this->assertEquals( $expected_normal, $output ); } @@ -128,6 +129,7 @@ $importer = new AzlChecksFileProbe( "null URI" ); $output = $importer->_parseRow( $data ); +$this->stripSourceData( $output ); $this->assertEquals( $expected_normal, $output ); } } diff --git a/sites/all/modules/offline2civicrm/tests/JpMorganFileTest.php b/sites/all/modules/offline2civicrm/tests/JpMorganFileTest.php index 23c032f..875a8d9 100644 --- a/sites/all/modules/offline2civicrm/tests/JpMorganFileTest.php +++ b/sites/all/modules/offline2civicrm/tests/JpMorganFileTest.php @@ -1,6 +1,6 @@ assertTrue( $output['gross'] > 0 ); unset( $output['gross'] ); +$this->stripSourceData( $output ); $this->assertEquals( $expected_normal, $output ); } diff --git a/sites/all/modules/offline2civicrm/tests/PayPalChecksFileTest.php b/sites/all/modules/offline2civicrm/tests/PayPalChecksFileTest.php index 9459017..ccd5005 100644 --- a/sites/all/modules/offline2civicrm/tests/PayPalChecksFileTest.php +++ b/sites/all/modules/offline2civicrm/tests/PayPalChecksFileTest.php @@ -1,6 +1,6 @@ _parseRow( $data ); +$this->stripSourceData( $output ); $this->assertEquals( $expected_normal, $output ); } } diff --git a/sites/all/modules/offline2civicrm/tests/includes/BaseChecksFileTest.php b/sites/all/modules/offline2civicrm/tests/includes/BaseChecksFileTest.php new file mode 100644 index 000..8cb6214 --- /dev/null +++ b/sites/all/modules/offline2civicrm/tests/includes/BaseChecksFileTest.php @@ -0,0 +1,20 @@ +assertEquals( 'direct', $msg['source_type'] ); +$importerClass = str_replace( 'Test', 'Probe', get_class( $this ) ); +$this->assertEquals( "Offline importer: {$importerClass}", $msg['source_name'] ); +$this->assertNotNull( $msg['source_host'] ); +$this->assertGreaterThan( 0, $msg['source_run_id'] ); +$this->assertNotNull( $msg['source_version'] ); +$this->assertGreaterThan( 0, $msg['source_enqueued_time'] ); + +unset( $msg['source_type'] ); +unset( $msg['source_name'] ); +unset( $msg['source_host'] ); +unset( $msg['source_run_id'] ); +unset( $msg['source_version'] ); +unset( $msg['source_enqueued_time'] ); +} +} -- To view, visit https://gerrit.wikimedia.org/r/160242 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I974878a5bc6c567faa88ca50b379495f61d8e946 Gerrit-PatchSet: 2 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: Awight Gerrit-Reviewer: Awight Gerrit-Reviewer: Ejegg Gerrit-Reviewer: Katie Horn Gerrit-Reviewer: Ssmith Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add a base test - change (wikimedia...crm)
Awight has uploaded a new change for review. https://gerrit.wikimedia.org/r/160242 Change subject: Add a base test .. Add a base test Currently, it just strips source data. This should be shared with other import tests. Change-Id: I974878a5bc6c567faa88ca50b379495f61d8e946 --- M sites/all/modules/offline2civicrm/offline2civicrm.info M sites/all/modules/offline2civicrm/tests/AzlChecksFileTest.php M sites/all/modules/offline2civicrm/tests/JpMorganFileTest.php M sites/all/modules/offline2civicrm/tests/PayPalChecksFileTest.php A sites/all/modules/offline2civicrm/tests/includes/BaseChecksFileTest.php 5 files changed, 31 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/42/160242/1 diff --git a/sites/all/modules/offline2civicrm/offline2civicrm.info b/sites/all/modules/offline2civicrm/offline2civicrm.info index bf13c7e..c772607 100644 --- a/sites/all/modules/offline2civicrm/offline2civicrm.info +++ b/sites/all/modules/offline2civicrm/offline2civicrm.info @@ -17,4 +17,5 @@ files[] = EmptyRowException.php files[] = JpMorganFile.php files[] = PayPalChecksFile.php +files[] = tests/includes/BaseChecksFileTest.test files[] = tests/ContributionConversion.test diff --git a/sites/all/modules/offline2civicrm/tests/AzlChecksFileTest.php b/sites/all/modules/offline2civicrm/tests/AzlChecksFileTest.php index fb6a650..35d1cd4 100644 --- a/sites/all/modules/offline2civicrm/tests/AzlChecksFileTest.php +++ b/sites/all/modules/offline2civicrm/tests/AzlChecksFileTest.php @@ -1,6 +1,7 @@ _parseRow( $data ); +$this->stripSourceData( $output ); $this->assertEquals( $expected_normal, $output ); } @@ -128,6 +130,7 @@ $importer = new AzlChecksFileProbe( "null URI" ); $output = $importer->_parseRow( $data ); +$this->stripSourceData( $output ); $this->assertEquals( $expected_normal, $output ); } } diff --git a/sites/all/modules/offline2civicrm/tests/JpMorganFileTest.php b/sites/all/modules/offline2civicrm/tests/JpMorganFileTest.php index 23c032f..7eb6f5b 100644 --- a/sites/all/modules/offline2civicrm/tests/JpMorganFileTest.php +++ b/sites/all/modules/offline2civicrm/tests/JpMorganFileTest.php @@ -1,6 +1,7 @@ assertTrue( $output['gross'] > 0 ); unset( $output['gross'] ); +$this->stripSourceData( $output ); $this->assertEquals( $expected_normal, $output ); } diff --git a/sites/all/modules/offline2civicrm/tests/PayPalChecksFileTest.php b/sites/all/modules/offline2civicrm/tests/PayPalChecksFileTest.php index 9459017..dca7a14 100644 --- a/sites/all/modules/offline2civicrm/tests/PayPalChecksFileTest.php +++ b/sites/all/modules/offline2civicrm/tests/PayPalChecksFileTest.php @@ -1,6 +1,7 @@ _parseRow( $data ); +$this->stripSourceData( $output ); $this->assertEquals( $expected_normal, $output ); } } diff --git a/sites/all/modules/offline2civicrm/tests/includes/BaseChecksFileTest.php b/sites/all/modules/offline2civicrm/tests/includes/BaseChecksFileTest.php new file mode 100644 index 000..8cb6214 --- /dev/null +++ b/sites/all/modules/offline2civicrm/tests/includes/BaseChecksFileTest.php @@ -0,0 +1,20 @@ +assertEquals( 'direct', $msg['source_type'] ); +$importerClass = str_replace( 'Test', 'Probe', get_class( $this ) ); +$this->assertEquals( "Offline importer: {$importerClass}", $msg['source_name'] ); +$this->assertNotNull( $msg['source_host'] ); +$this->assertGreaterThan( 0, $msg['source_run_id'] ); +$this->assertNotNull( $msg['source_version'] ); +$this->assertGreaterThan( 0, $msg['source_enqueued_time'] ); + +unset( $msg['source_type'] ); +unset( $msg['source_name'] ); +unset( $msg['source_host'] ); +unset( $msg['source_run_id'] ); +unset( $msg['source_version'] ); +unset( $msg['source_enqueued_time'] ); +} +} -- To view, visit https://gerrit.wikimedia.org/r/160242 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I974878a5bc6c567faa88ca50b379495f61d8e946 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: master Gerrit-Owner: Awight ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits