Skip to content

Commit

Permalink
improved tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nemiah committed May 6, 2017
1 parent 499e9f0 commit 88d2e5f
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 27 deletions.
6 changes: 3 additions & 3 deletions test/directDebitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
use nemiah\phpSepaXml\SEPADirectDebitBasic;
use nemiah\phpSepaXml\SEPACreditor;
use nemiah\phpSepaXml\SEPADebitor;
use nemiah\phpSepaXml\SEPAParty;

class directDebitTest extends PHPUnit_Framework_TestCase {

Expand Down Expand Up @@ -42,10 +41,11 @@ public function test() {


try {
#echo $sepaDD->toXML();
$sepaDD->toXML();
return true;
} catch (Exception $e){
echo "<p>".$sepaDD->errors()."</p>";
echo $sepaDD->errors();
return false;
}
}
}
24 changes: 0 additions & 24 deletions test/phpSepaXml.php

This file was deleted.

55 changes: 55 additions & 0 deletions test/transferTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php

#require_once '../src/php-sepa-xml';
use nemiah\phpSepaXml\SEPADirectDebitBasic;
use nemiah\phpSepaXml\SEPACreditor;
use nemiah\phpSepaXml\SEPADebitor;

class transferTest extends PHPUnit_Framework_TestCase {

public function test() {
throw new Exception("Not yet implemented");

return false;

$dt = new \DateTime();
$dt->add(new \DateInterval("P8D"));

$sepaDD = new SEPADirectDebitBasic(array(
'messageID' => time(),
'paymentID' => 'TRF-INVOICE-130904',
'requestedCollectionDate' => $dt
));

$sepaDD->setCreditor(new SEPACreditor(array(
'name' => 'My Company',
'iban' => 'DE68210501700012345678',
'bic' => 'DEUTDEDB400',
'identifier' => 'DE98ZZZ09999999999'
)));


$sepaDD->addDebitor(new SEPADebitor(array(
'transferID' => 'Invoice 130904-131',
'mandateID' => '37294',
'mandateDateOfSignature' => '2013-07-14',
'name' => 'Max Mustermann',
'iban' => 'CH9300762011623852957',
'bic' => 'GENODEF1P15',
'amount' => 0.01,
'currency' => 'EUR',
'info' => 'Info text. Invoice 130904-131',
'requestedCollectionDate' => $dt,
'sequenceType' => "OOFF"
)));


try {
$sepaDD->toXML();
return true;
} catch (Exception $e){
echo $sepaDD->errors();
return false;
}
}
}

0 comments on commit 88d2e5f

Please sign in to comment.