-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
71 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ | |
|
||
namespace Tests\Greenter\Xml\Builder; | ||
|
||
use Greenter\Data\Generator\InvoiceFullStore; | ||
use Greenter\Data\Generator\InvoiceStore; | ||
use Greenter\Model\Sale\Invoice; | ||
|
||
/** | ||
|
@@ -21,34 +23,18 @@ class FeInvoiceBuilderTest extends \PHPUnit_Framework_TestCase | |
|
||
public function testCreateXmlInvoice() | ||
{ | ||
$invoice = $this->getFullInvoice(); | ||
$this->loadExtras($invoice); | ||
$invoice = $this->createDocument(InvoiceFullStore::class); | ||
|
||
$xml = $this->build($invoice); | ||
|
||
// file_put_contents('x.xml', $xml); | ||
$this->assertNotEmpty($xml); | ||
$this->assertSchema($xml); | ||
} | ||
|
||
public function testCompanyValidate() | ||
{ | ||
$company = $this->getCompany(); | ||
$adress = $company->getAddress(); | ||
|
||
$this->assertNotNull($company->getAddress()); | ||
$this->assertNotEmpty($company->getNombreComercial()); | ||
$this->assertNotEmpty($company->getRazonSocial()); | ||
$this->assertNotEmpty($company->getRuc()); | ||
$this->assertNotEmpty($adress->getDepartamento()); | ||
$this->assertNotEmpty($adress->getProvincia()); | ||
$this->assertNotEmpty($adress->getDistrito()); | ||
$this->assertNotEmpty($adress->getUrbanizacion()); | ||
} | ||
|
||
public function testInvoiceFilename() | ||
{ | ||
$invoice = $this->getInvoice(); | ||
/**@var $invoice Invoice*/ | ||
$invoice = $this->createDocument(InvoiceStore::class); | ||
$filename = $invoice->getName(); | ||
|
||
$this->assertEquals($this->getFilename($invoice), $filename); | ||
|
@@ -65,23 +51,4 @@ private function getFileName(Invoice $invoice) | |
|
||
return join('-', $parts); | ||
} | ||
|
||
private function loadExtras(Invoice $invoice) | ||
{ | ||
$invoice->getCompany() | ||
->setEmail('[email protected]') | ||
->setTelephone('001-123243'); | ||
|
||
$invoice->getClient() | ||
->setEmail('[email protected]') | ||
->setTelephone('001-445566'); | ||
|
||
$invoice->setSeller($this->getClient() | ||
->setTipoDoc('0') | ||
->setNumDoc('00000000') | ||
->setRznSocial('Super Seller') | ||
->setEmail('[email protected]') | ||
->setTelephone('990134255')); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.