svn: /pear/packages/Payment_DTA/trunk/tests/ DTAZVTest.php

From: Date: Mon, 06 Sep 2010 16:13:26 +0000
Subject: svn: /pear/packages/Payment_DTA/trunk/tests/ DTAZVTest.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-60282@lists.php.net to get a copy of this message
mschuett Mon, 06 Sep 2010 16:13:26 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=303098 Log: add a little more coverage Changed paths: U pear/packages/Payment_DTA/trunk/tests/DTAZVTest.php Modified: pear/packages/Payment_DTA/trunk/tests/DTAZVTest.php =================================================================== --- pear/packages/Payment_DTA/trunk/tests/DTAZVTest.php 2010-09-06 16:05:02 UTC (rev 303097) +++ pear/packages/Payment_DTA/trunk/tests/DTAZVTest.php 2010-09-06 16:13:26 UTC (rev 303098) @@ -984,4 +984,48 @@ get_class($errors[1])); } + public function testParserInvalidZRecord() + { + $dates = strftime("%d%m%y00%d%m%y", time()); + $teststring = // same as in testContent() but text in Z record padding + '0256Q160500003503007767SENDERS NAME '. + ' '. + ' '.$dates.'N0000000000 '. + ' '. + '0768T16050000EUR350300776700000000000000 0000000000RZTIAT22263'. + ' '. + ' '. + ' DE RECEIVERS NAME '. + ' '. + ' '. + ' /DE21700519950000007229 '. + ' EUR00000000000123450TEST-VERWENDUNGSZWECK '. + ' '. + ' 00000000 '. + ' 0013 '. + ' 0 00'. + '0768T16050000EUR350300776700000000000000 0000000000RZTIAT22263'. + ' '. + ' '. + ' DE SECOND RECEIVERS NAME '. + ' '. + ' '. + ' /DE21700519950000007229 '. + ' EUR00000000000234560TEST2 '. + ' '. + ' 00000000 '. + ' 0013 '. + ' 0 00'. + '0256Z000000000000357000000000000002 '. + ' blubb '. + ' '. + ' '; + $dtazv = new DTAZV($teststring); + $this->assertSame(2, $dtazv->count()); + $errors = $dtazv->getParsingErrors(); + // first error for skipped C record, second error for checksum + $this->assertEquals('Payment_DTA_ParseException', + get_class($errors[0])); + } + }

« previous php.pear.cvs (#60282) next »