Eileen has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/364619 )
Change subject: Merge branch 'master' of https://gerrit.wikimedia.org/r/wikimedia/fundraising/crm into deployment ...................................................................... Merge branch 'master' of https://gerrit.wikimedia.org/r/wikimedia/fundraising/crm into deployment 1253580 Initial commit, omnimail extension & extendedmailingreport 8a86f99 Add composer-merge-plugin 34cf6cc PHPunit 5.7, not 5.6 7f680ea Update phpunit to use 5.7 a375a01 CurrencyRates template: add SmashPig namespace Change-Id: If6079ab119bd1518b2a531d0ec6e6517f79a68c6 --- D phpunit.xml D sites/all/modules/wmf_communication/tests/phpunit/SilverpopImporterTest.php 2 files changed, 0 insertions(+), 185 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/19/364619/1 diff --git a/phpunit.xml b/phpunit.xml deleted file mode 100644 index 0f6cfbb..0000000 --- a/phpunit.xml +++ /dev/null @@ -1,47 +0,0 @@ -<<<<<<< HEAD (d26886 Merge branch 'master' into deployment) -======= -<phpunit - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/3.7/phpunit.xsd" - bootstrap="sites/default/bootstrap-phpunit.php"> - - - <testsuites> - <testsuite name="large_donation tests"> - <directory>sites/all/modules/large_donation/tests</directory> - </testsuite> - <testsuite name="offline2civicrm tests"> - <directory>sites/all/modules/offline2civicrm/tests</directory> - <exclude>sites/all/modules/offline2civicrm/tests/includes/BaseChecksFileTest.php</exclude> - </testsuite> - <testsuite name="exchange_rates tests"> - <directory>sites/all/modules/exchange_rates/tests/phpunit</directory> - </testsuite> - <testsuite name="queue2civicrm tests"> - <directory>sites/all/modules/queue2civicrm/tests/phpunit</directory> - </testsuite> - <testsuite name="recurring_globalcollect tests"> - <directory>sites/all/modules/recurring_globalcollect/tests</directory> - </testsuite> - <testsuite name="wmf_audit tests"> - <directory>sites/all/modules/wmf_audit/tests</directory> - </testsuite> - <testsuite name="wmf_campaigns tests"> - <directory>sites/all/modules/wmf_campaigns/tests</directory> - </testsuite> - <testsuite name="wmf_civicrm tests"> - <directory>sites/all/modules/wmf_civicrm/tests/phpunit</directory> - </testsuite> - <testsuite name="wmf_common tests"> - <directory>sites/all/modules/wmf_common/tests/phpunit</directory> - </testsuite> - <testsuite name="wmf_communication tests"> - <directory>sites/all/modules/wmf_communication/tests/phpunit</directory> - <exclude>sites/all/modules/wmf_communication/tests/phpunit/CiviMailTestBase.php</exclude> - </testsuite> - <testsuite name="omnimail_tests"> - <directory>sites/default/civicrm/extensions/org.wikimedia.omnimail/tests/phpunit</directory> - </testsuite> - </testsuites> -</phpunit> ->>>>>>> BRANCH (125358 Initial commit, omnimail extension & extendedmailingreport) diff --git a/sites/all/modules/wmf_communication/tests/phpunit/SilverpopImporterTest.php b/sites/all/modules/wmf_communication/tests/phpunit/SilverpopImporterTest.php deleted file mode 100644 index 94b4d36..0000000 --- a/sites/all/modules/wmf_communication/tests/phpunit/SilverpopImporterTest.php +++ /dev/null @@ -1,138 +0,0 @@ -<<<<<<< HEAD (d26886 Merge branch 'master' into deployment) -======= -<?php -namespace wmf_communication; -use \BaseWmfDrupalPhpUnitTestCase; - -/** - * @group CiviMail - * @group WmfCommunication - */ -class SilverpopImporterTest extends BaseWmfDrupalPhpUnitTestCase { - function testImport() { - $sftp = $this->getMockBuilder( 'Net_SFTP' ) - ->disableOriginalConstructor() - ->setMethods( array( 'login', 'get', 'disconnect' ) ) - ->getMock(); - $mailStore = $this->createMock( 'wmf_communication\CiviMailBulkStore'); - $zipper = $this->createMock( 'ZipArchive'); - $mailing = $this->createMock( 'wmf_communication\ICiviMailingRecord'); - - $tempDir = file_directory_temp(); - - $sftp->expects( $this->atLeastOnce() ) - ->method( 'login' ) - ->with( 'TestUser', 'TestPass' ) - ->will( $this->returnValue( true ) ); - - $sftp->expects( $this->once() ) - ->method( 'get' ) - ->with( 'download/Raw Recipient Data Export Sep 02 2014 18-45-05 PM 1200.zip', - "$tempDir/Raw Recipient Data Export Sep 02 2014 18-45-05 PM 1200.zip" ) - ->will( $this->returnValue( true ) ); - - $zipper->expects( $this->once() ) - ->method( 'open' ) - ->with( "$tempDir/Raw Recipient Data Export Sep 02 2014 18-45-05 PM 1200.zip" ) - ->will( $this->returnValue( true ) ); - - $zipper->expects( $this->once() ) - ->method( 'extractTo' ) - ->with( $tempDir ) - ->will( $this->returnValue( true ) ); - - $mailStore->expects( $this->once() ) - ->method( 'getMailing' ) - ->with( 'Silverpop', '9876543' ) - ->will( $this->ThrowException( new CiviMailingMissingException() ) ); - - $mailStore->expects( $this->once() ) - ->method( 'addMailing' ) - ->with( 'Silverpop', '9876543', $this->anything(), 'Test Subject', 0, 'RUNNING' ) - ->will( $this->returnValue( $mailing ) ); - - $emails = array(); - $fileContents = "Recipient Id,Recipient Type,Mailing Id,Report Id,Campaign Id,Email,Event Type,Event Timestamp,Body Type,Content Id,Click Name,URL,Conversion Action,Conversion Detail,Conversion Amount,Suppression Reason,,\n"; - for( $i = 0; $i < 10; $i++ ) { - $email = "test.user.$i...@example.com"; - $emails[] = $email; - $fileContents .= mt_rand(); - $fileContents .= ',Normal,9876543,503612902,"",'; - $fileContents .= $email; - $fileContents .= ',Sent,08/29/2014 12:00:08,"","","","","","","","","",""'; - $fileContents .= "\n"; - } - //add a suppressed record to the end to see that we don't insert it along with the sent - $fileContents .= '105817151078,Normal,9876543,503612902,"",test.user...@example.com,Suppressed,08/29/2014 12:00:08,"","","","","","","",Organization Suppression List,"",""' . "\n"; - // Writing a real file since we're not mocking CsvBatchFile - file_put_contents( "$tempDir/Raw Recipient Data Export Sep 02 2014 18-45-05 PM 1200.csv", $fileContents ); - - $mailStore->expects( $this->once() ) - ->method( 'addSentBulk' ) - ->with( $mailing, $emails ); - - $options = array( - 'engage' => new FakeEngage(), - 'username' => 'TestUser', - 'password' => 'TestPass', - 'sftp' => $sftp, - 'civimailstore' => $mailStore, - 'zipper' => $zipper, - ); - - $silverpopImporter = new SilverpopImporter( $options ); - - $silverpopImporter->import( 1 ); - - //TODO: assert some things about $engage->executeArgs; - } -} - -class FakeEngage { - public $executeResponses = array( - 'GetSentMailingsForOrg' => '<Mailing> -<MailingId>9876543</MailingId> -<ReportId>135791113</ReportId> -<ScheduledTS>2014-09-02 13:24:23.0</ScheduledTS> -<MailingName><![CDATA[Test Mailing]]></MailingName> -<ListName><![CDATA[Test List]]></ListName> -<ListId>1234567</ListId> -<UserName>Mailing Sender</UserName> -<SentTS>2014-09-02 13:25:12.0</SentTS> -<NumSent>3</NumSent> -<Subject><![CDATA[Test Subject]]></Subject> -<Visibility>Shared</Visibility> -</Mailing>', - 'RawRecipientDataExport' => '<MAILING> -<JOB_ID>77665544</JOB_ID> -<FILE_PATH>Raw Recipient Data Export Sep 02 2014 18-45-05 PM 1200.zip</FILE_PATH> -</MAILING>', - 'GetJobStatus' => '<JOB_ID>77665544</JOB_ID> -<JOB_STATUS>COMPLETE</JOB_STATUS> -<JOB_DESCRIPTION>Export raw recipient data.</JOB_DESCRIPTION> -<PARAMETERS> -</PARAMETERS>' - ); - - public function login() { - return true; - } - - public $executeArgs = array(); - /** - * @param SimpleXMLElement $simplexml - */ - public function execute( $simplexml ) { - $kids = $simplexml->Body->children(); - $nodeName = $kids[0]->getName(); - $this->executeArgs[$nodeName] = $simplexml; - return simplexml_load_string("<Body> -<RESULT> -<SUCCESS>TRUE</SUCCESS> -" . $this->executeResponses[$nodeName] . " -</RESULT> -</Body> -"); - } -} ->>>>>>> BRANCH (125358 Initial commit, omnimail extension & extendedmailingreport) -- To view, visit https://gerrit.wikimedia.org/r/364619 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If6079ab119bd1518b2a531d0ec6e6517f79a68c6 Gerrit-PatchSet: 1 Gerrit-Project: wikimedia/fundraising/crm Gerrit-Branch: deployment Gerrit-Owner: Eileen <emcnaugh...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits