diff --git a/tests/DatiAnagraficiTest.php b/tests/DatiAnagraficiTest.php index e20a75e..0878046 100644 --- a/tests/DatiAnagraficiTest.php +++ b/tests/DatiAnagraficiTest.php @@ -1,13 +1,11 @@ assertInstanceOf(DatiBeniServizi::class, $datiBeniServizi); + $this->assertNull($datiBeniServizi->XmlDatiBeniServizi); + } +} diff --git a/tests/DatiGeneraliDocumentoTest.php b/tests/DatiGeneraliDocumentoTest.php new file mode 100644 index 0000000..0ce884e --- /dev/null +++ b/tests/DatiGeneraliDocumentoTest.php @@ -0,0 +1,39 @@ +assertInstanceOf(DatiGeneraliDocumento::class, $datiGeneraliDocumento); + $this->assertEquals($numero, $datiGeneraliDocumento->Numero); + $this->assertEquals($data, $datiGeneraliDocumento->Data); + $this->assertEquals($importoTotaleDocumento, $datiGeneraliDocumento->ImportoTotaleDocumento); + $this->assertEquals(Settings::CausaleDefault(), $datiGeneraliDocumento->Causale); + $this->assertEquals(Settings::TipoDocumentoDefault(), $datiGeneraliDocumento->TipoDocumento); + $this->assertEquals(Settings::ValutaDefault(), $datiGeneraliDocumento->Divisa); + } + + public function testValidation(): void + { + $datiGeneraliDocumento = new DatiGeneraliDocumento('123', '2023-11-13', 123.45); + + $validator = Validation::createValidatorBuilder()->enableAnnotationMapping()->getValidator(); + + $violations = $validator->validate($datiGeneraliDocumento); + + $this->assertCount(0, $violations); + } +} diff --git a/tests/DatiGeneraliTest.php b/tests/DatiGeneraliTest.php new file mode 100644 index 0000000..a681ca0 --- /dev/null +++ b/tests/DatiGeneraliTest.php @@ -0,0 +1,24 @@ +assertInstanceOf(DatiGenerali::class, $datiGenerali); + $this->assertInstanceOf(DatiGeneraliDocumento::class, $datiGenerali->DatiGeneraliDocumento); + } +} diff --git a/tests/DatiPagamentoTest.php b/tests/DatiPagamentoTest.php new file mode 100644 index 0000000..2e80132 --- /dev/null +++ b/tests/DatiPagamentoTest.php @@ -0,0 +1,23 @@ +assertInstanceOf(DatiPagamento::class, $datiPagamento); + $this->assertInstanceOf(DettaglioPagamento::class, $datiPagamento->DettaglioPagamento); + $this->assertEquals(Settings::CondizioniPagamentoDefault(), $datiPagamento->CondizioniPagamento); + } +}