Skip to content

Commit

Permalink
Restore tests
Browse files Browse the repository at this point in the history
  • Loading branch information
giansalex committed Oct 10, 2017
1 parent 2d40c2c commit 8bc0f09
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 10 deletions.
29 changes: 19 additions & 10 deletions tests/Greenter/Factory/CeFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,6 @@ public function testDespatch()
);
}

public function testDespatchException()
{
$despatch = $this->getDespatch();
$despatch->setTipoDoc('000');
$this->getFactoryResult($despatch);
}

public function testRetention()
{
Expand All @@ -58,6 +52,9 @@ public function testRetention()
);
}

/**
* @expectedException \Greenter\Xml\Exception\ValidationException
*/
public function testRetentionException()
{
$retention = $this->getRetention();
Expand Down Expand Up @@ -89,13 +86,19 @@ public function testPerceptionNotValidTasa()
$this->assertEquals('2603', $result->getError()->getCode());
}

/**
* @expectedException \Greenter\Xml\Exception\ValidationException
*/
public function testPerceptionException()
{
$perception = $this->getPerception();
$perception->setSerie('FF000');
$this->getFactoryResult($perception);
}

/**
* @expectedException \Greenter\Xml\Exception\ValidationException
*/
public function testCreateXmlIPerceptionException()
{
$perception = $this->getPerception();
Expand All @@ -122,13 +125,19 @@ public function testReversion()
return $result->getTicket();
}

/**
* @expectedException \Greenter\Xml\Exception\ValidationException
*/
public function testReversionException()
{
$reversion = $this->getReversion();
$reversion->getDetails()[0]->setTipoDoc('100');
$this->getFactoryResult($reversion);
}

/**
* @expectedException \Greenter\Xml\Exception\ValidationException
*/
public function testXmlReversionException()
{
$reversion = $this->getReversion();
Expand All @@ -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);
}
Expand Down
24 changes: 24 additions & 0 deletions tests/Greenter/Factory/FeFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public function testInvoice()
$this->assertNotEmpty($result->getCdrZip());
}

/**
* @expectedException \Greenter\Xml\Exception\ValidationException
*/
public function testCreateXmlInvoiceException()
{
$invoice = $this->getInvoice();
Expand Down Expand Up @@ -65,6 +68,9 @@ public function testInvoiceNotValidZipFileName()
$this->assertEquals('0151', $result->getError()->getCode());
}

/**
* @expectedException \Greenter\Xml\Exception\ValidationException
*/
public function testXmlCreditNoteException()
{
$note = $this->getCreditNote();
Expand All @@ -84,6 +90,9 @@ public function testInvoiceRechazado()
$this->assertEquals('2016', $result->getError()->getCode());
}

/**
* @expectedException \Greenter\Xml\Exception\ValidationException
*/
public function testInvoiceInvalid()
{
$invoice = $this->getInvoice();
Expand All @@ -104,6 +113,9 @@ public function testNotaCredito()
);
}

/**
* @expectedException \Greenter\Xml\Exception\ValidationException
*/
public function testCreditNoteException()
{
$creditNote = $this->getCreditNote();
Expand All @@ -124,6 +136,9 @@ public function testNotaDebito()
);
}

/**
* @expectedException \Greenter\Xml\Exception\ValidationException
*/
public function testDebitNoteException()
{
$debitNote = $this->getDebitNote();
Expand All @@ -146,6 +161,9 @@ public function testResumen()
$result->getError()->getMessage());
}

/**
* @expectedException \Greenter\Xml\Exception\ValidationException
*/
public function testXmlSummaryException()
{
$summary = $this->getSummary();
Expand All @@ -166,13 +184,19 @@ public function testResumenV2()
$this->assertEquals(13, strlen($result->getTicket()));
}

/**
* @expectedException \Greenter\Xml\Exception\ValidationException
*/
public function testResumenException()
{
$resumen = $this->getSummary();
$resumen->setCorrelativo('1234');
$this->getFactoryResult($resumen);
}

/**
* @expectedException \Greenter\Xml\Exception\ValidationException
*/
public function testXmlSummaryV2Exception()
{
$summary = $this->getSummary();
Expand Down

0 comments on commit 8bc0f09

Please sign in to comment.