From 8bc0f09c551de293af1ef6ca9d6a1baa09f02c84 Mon Sep 17 00:00:00 2001 From: giansalex Date: Tue, 10 Oct 2017 16:32:10 -0500 Subject: [PATCH] Restore tests --- tests/Greenter/Factory/CeFactoryTest.php | 29 ++++++++++++++++-------- tests/Greenter/Factory/FeFactoryTest.php | 24 ++++++++++++++++++++ 2 files changed, 43 insertions(+), 10 deletions(-) diff --git a/tests/Greenter/Factory/CeFactoryTest.php b/tests/Greenter/Factory/CeFactoryTest.php index d03a5142..05f47dc0 100644 --- a/tests/Greenter/Factory/CeFactoryTest.php +++ b/tests/Greenter/Factory/CeFactoryTest.php @@ -38,12 +38,6 @@ public function testDespatch() ); } - public function testDespatchException() - { - $despatch = $this->getDespatch(); - $despatch->setTipoDoc('000'); - $this->getFactoryResult($despatch); - } public function testRetention() { @@ -58,6 +52,9 @@ public function testRetention() ); } + /** + * @expectedException \Greenter\Xml\Exception\ValidationException + */ public function testRetentionException() { $retention = $this->getRetention(); @@ -89,6 +86,9 @@ public function testPerceptionNotValidTasa() $this->assertEquals('2603', $result->getError()->getCode()); } + /** + * @expectedException \Greenter\Xml\Exception\ValidationException + */ public function testPerceptionException() { $perception = $this->getPerception(); @@ -96,6 +96,9 @@ public function testPerceptionException() $this->getFactoryResult($perception); } + /** + * @expectedException \Greenter\Xml\Exception\ValidationException + */ public function testCreateXmlIPerceptionException() { $perception = $this->getPerception(); @@ -122,6 +125,9 @@ public function testReversion() return $result->getTicket(); } + /** + * @expectedException \Greenter\Xml\Exception\ValidationException + */ public function testReversionException() { $reversion = $this->getReversion(); @@ -129,6 +135,9 @@ public function testReversionException() $this->getFactoryResult($reversion); } + /** + * @expectedException \Greenter\Xml\Exception\ValidationException + */ public function testXmlReversionException() { $reversion = $this->getReversion(); @@ -151,10 +160,10 @@ public function testStatus($ticket) $result ->setCode('0') ->setCdrResponse((new CdrResponse()) - ->setDescription('El Comprobante numero RR-20171001-001 ha sido aceptado') - ->setId('RR-20171001-001') - ->setCode('0') - ->setNotes([])) + ->setDescription('El Comprobante numero RR-20171001-001 ha sido aceptado') + ->setId('RR-20171001-001') + ->setCode('0') + ->setNotes([])) ->setCdrZip('xx') ->setSuccess(true); } diff --git a/tests/Greenter/Factory/FeFactoryTest.php b/tests/Greenter/Factory/FeFactoryTest.php index be789bcb..e012fb01 100644 --- a/tests/Greenter/Factory/FeFactoryTest.php +++ b/tests/Greenter/Factory/FeFactoryTest.php @@ -33,6 +33,9 @@ public function testInvoice() $this->assertNotEmpty($result->getCdrZip()); } + /** + * @expectedException \Greenter\Xml\Exception\ValidationException + */ public function testCreateXmlInvoiceException() { $invoice = $this->getInvoice(); @@ -65,6 +68,9 @@ public function testInvoiceNotValidZipFileName() $this->assertEquals('0151', $result->getError()->getCode()); } + /** + * @expectedException \Greenter\Xml\Exception\ValidationException + */ public function testXmlCreditNoteException() { $note = $this->getCreditNote(); @@ -84,6 +90,9 @@ public function testInvoiceRechazado() $this->assertEquals('2016', $result->getError()->getCode()); } + /** + * @expectedException \Greenter\Xml\Exception\ValidationException + */ public function testInvoiceInvalid() { $invoice = $this->getInvoice(); @@ -104,6 +113,9 @@ public function testNotaCredito() ); } + /** + * @expectedException \Greenter\Xml\Exception\ValidationException + */ public function testCreditNoteException() { $creditNote = $this->getCreditNote(); @@ -124,6 +136,9 @@ public function testNotaDebito() ); } + /** + * @expectedException \Greenter\Xml\Exception\ValidationException + */ public function testDebitNoteException() { $debitNote = $this->getDebitNote(); @@ -146,6 +161,9 @@ public function testResumen() $result->getError()->getMessage()); } + /** + * @expectedException \Greenter\Xml\Exception\ValidationException + */ public function testXmlSummaryException() { $summary = $this->getSummary(); @@ -166,6 +184,9 @@ public function testResumenV2() $this->assertEquals(13, strlen($result->getTicket())); } + /** + * @expectedException \Greenter\Xml\Exception\ValidationException + */ public function testResumenException() { $resumen = $this->getSummary(); @@ -173,6 +194,9 @@ public function testResumenException() $this->getFactoryResult($resumen); } + /** + * @expectedException \Greenter\Xml\Exception\ValidationException + */ public function testXmlSummaryV2Exception() { $summary = $this->getSummary();