diff --git a/src/CfdiUtils/Elements/CartaPorte10/Arrendatario.php b/src/CfdiUtils/Elements/CartaPorte10/Arrendatario.php new file mode 100644 index 00000000..bc7f3d3c --- /dev/null +++ b/src/CfdiUtils/Elements/CartaPorte10/Arrendatario.php @@ -0,0 +1,27 @@ +helperGetOrAdd(new Domicilio()); + } + + public function addDomicilio(array $attributes = []): Domicilio + { + $domicilio = $this->getDomicilio(); + $domicilio->addAttributes($attributes); + + return $domicilio; + } +} diff --git a/src/CfdiUtils/Elements/CartaPorte10/AutotransporteFederal.php b/src/CfdiUtils/Elements/CartaPorte10/AutotransporteFederal.php new file mode 100644 index 00000000..eb6282dd --- /dev/null +++ b/src/CfdiUtils/Elements/CartaPorte10/AutotransporteFederal.php @@ -0,0 +1,41 @@ +addChild($identificacionVehicular); + + return $identificacionVehicular; + } + + public function getIdentificacionVehicular(): IdentificacionVehicular + { + /** @noinspection PhpIncompatibleReturnTypeInspection */ + return $this->helperGetOrAdd(new IdentificacionVehicular()); + } + + public function addRemolques(array $attributes = []): Remolques + { + $remolques = new Remolques($attributes); + $this->addChild($remolques); + + return $remolques; + } + + public function getRemolques(): Remolques + { + /** @noinspection PhpIncompatibleReturnTypeInspection */ + return $this->helperGetOrAdd(new Remolques()); + } +} diff --git a/src/CfdiUtils/Elements/CartaPorte10/CantidadTransporta.php b/src/CfdiUtils/Elements/CartaPorte10/CantidadTransporta.php new file mode 100644 index 00000000..c7c440f7 --- /dev/null +++ b/src/CfdiUtils/Elements/CartaPorte10/CantidadTransporta.php @@ -0,0 +1,13 @@ +addChild($contenedor); + + return $contenedor; + } + + public function multiContenedor(array ...$elementAttributes): self + { + foreach ($elementAttributes as $attributes) { + $this->addContenedor($attributes); + } + return $this; + } +} diff --git a/src/CfdiUtils/Elements/CartaPorte10/CartaPorte.php b/src/CfdiUtils/Elements/CartaPorte10/CartaPorte.php new file mode 100644 index 00000000..3e6c4371 --- /dev/null +++ b/src/CfdiUtils/Elements/CartaPorte10/CartaPorte.php @@ -0,0 +1,74 @@ + 'http://www.sat.gob.mx/cartaporte', + 'xsi:schemaLocation' => 'http://www.sat.gob.mx/cartaporte' + . ' http://www.sat.gob.mx/sitio_internet/cfd/CartaPorte/CartaPorte.xsd', + 'Version' => '1.0', + ]; + } + + public function getUbicaciones(): Ubicaciones + { + /** @noinspection PhpIncompatibleReturnTypeInspection */ + return $this->helperGetOrAdd(new Ubicaciones()); + } + + public function addUbicaciones(array $attributes = []): Ubicaciones + { + $ubicaciones = $this->getUbicaciones(); + $ubicaciones->addAttributes($attributes); + + return $ubicaciones; + } + + public function getMercancias(): Mercancias + { + /** @noinspection PhpIncompatibleReturnTypeInspection */ + return $this->helperGetOrAdd(new Mercancias()); + } + + public function addMercancias(array $attributes = []): Mercancias + { + $mercancias = $this->getMercancias(); + $mercancias->addAttributes($attributes); + + return $mercancias; + } + + public function getFiguraTransporte(): FiguraTransporte + { + /** @noinspection PhpIncompatibleReturnTypeInspection */ + return $this->helperGetOrAdd(new FiguraTransporte()); + } + + public function addFiguraTransporte(array $attributes = []): FiguraTransporte + { + $figuraTransporte = $this->getFiguraTransporte(); + $figuraTransporte->addAttributes($attributes); + + return $figuraTransporte; + } +} diff --git a/src/CfdiUtils/Elements/CartaPorte10/Contenedor.php b/src/CfdiUtils/Elements/CartaPorte10/Contenedor.php new file mode 100644 index 00000000..b28f76f9 --- /dev/null +++ b/src/CfdiUtils/Elements/CartaPorte10/Contenedor.php @@ -0,0 +1,13 @@ +addChild($operadores); + + return $operadores; + } + + public function multiOperadores(array ...$elementAttributes): self + { + foreach ($elementAttributes as $attributes) { + $this->addOperadores($attributes); + } + return $this; + } + + public function addPropietario(array $attributes = []): Propietario + { + $propietario = new Propietario($attributes); + $this->addChild($propietario); + + return $propietario; + } + + public function multiPropietario(array ...$elementAttributes): self + { + foreach ($elementAttributes as $attributes) { + $this->addPropietario($attributes); + } + return $this; + } + + public function addArrendatario(array $attributes = []): Arrendatario + { + $arrendatario = new Arrendatario($attributes); + $this->addChild($arrendatario); + + return $arrendatario; + } + + public function multiArrendatario(array ...$elementAttributes): self + { + foreach ($elementAttributes as $attributes) { + $this->addArrendatario($attributes); + } + return $this; + } + + public function addNotificado(array $attributes = []): Notificado + { + $arrendatario = new Notificado($attributes); + $this->addChild($arrendatario); + + return $arrendatario; + } + + public function multiNotificado(array ...$elementAttributes): self + { + foreach ($elementAttributes as $attributes) { + $this->addNotificado($attributes); + } + return $this; + } +} diff --git a/src/CfdiUtils/Elements/CartaPorte10/IdentificacionVehicular.php b/src/CfdiUtils/Elements/CartaPorte10/IdentificacionVehicular.php new file mode 100644 index 00000000..138bf499 --- /dev/null +++ b/src/CfdiUtils/Elements/CartaPorte10/IdentificacionVehicular.php @@ -0,0 +1,13 @@ +addChild($cantidadTransporta); + + return $cantidadTransporta; + } + + public function multiCantidadTransporta(array ...$elementAttributes): self + { + foreach ($elementAttributes as $attributes) { + $this->addCantidadTransporta($attributes); + } + return $this; + } + + public function addDetalleMercancia(array $attributes = []): DetalleMercancia + { + $detalleMercancia = new DetalleMercancia($attributes); + $this->addChild($detalleMercancia); + + return $detalleMercancia; + } + + public function getDetalleMercancia(): DetalleMercancia + { + /** @noinspection PhpIncompatibleReturnTypeInspection */ + return $this->helperGetOrAdd(new DetalleMercancia()); + } +} diff --git a/src/CfdiUtils/Elements/CartaPorte10/Mercancias.php b/src/CfdiUtils/Elements/CartaPorte10/Mercancias.php new file mode 100644 index 00000000..7b7ab9cd --- /dev/null +++ b/src/CfdiUtils/Elements/CartaPorte10/Mercancias.php @@ -0,0 +1,60 @@ +addChild($mercancia); + return $mercancia; + } + + public function multiMercancia(array ...$elementAttributes): self + { + foreach ($elementAttributes as $attributes) { + $this->addMercancia($attributes); + } + return $this; + } + + public function addAutotransporteFederal(array $attributes = []): AutotransporteFederal + { + $autotransporteFederal = new AutotransporteFederal($attributes); + $this->addChild($autotransporteFederal); + + return $autotransporteFederal; + } + + public function addTransporteMaritimo(array $attributes = []): TransporteMaritimo + { + $transporteMaritimo = new TransporteMaritimo($attributes); + $this->addChild($transporteMaritimo); + + return $transporteMaritimo; + } + + public function addTransporteAereo(array $attributes = []): TransporteAereo + { + $transporteAereo = new TransporteAereo($attributes); + $this->addChild($transporteAereo); + + return $transporteAereo; + } + + public function addTransporteFerroviario(array $attributes = []): TransporteFerroviario + { + $transporteFerroviario = new TransporteFerroviario($attributes); + $this->addChild($transporteFerroviario); + + return $transporteFerroviario; + } +} diff --git a/src/CfdiUtils/Elements/CartaPorte10/Notificado.php b/src/CfdiUtils/Elements/CartaPorte10/Notificado.php new file mode 100644 index 00000000..5e5fb3e9 --- /dev/null +++ b/src/CfdiUtils/Elements/CartaPorte10/Notificado.php @@ -0,0 +1,13 @@ +helperGetOrAdd(new Domicilio()); + } + + public function addDomicilio(array $attributes = []): Domicilio + { + $domicilio = $this->getDomicilio(); + $domicilio->addAttributes($attributes); + + return $domicilio; + } +} diff --git a/src/CfdiUtils/Elements/CartaPorte10/Operadores.php b/src/CfdiUtils/Elements/CartaPorte10/Operadores.php new file mode 100644 index 00000000..e22d5f89 --- /dev/null +++ b/src/CfdiUtils/Elements/CartaPorte10/Operadores.php @@ -0,0 +1,29 @@ +addChild($operador); + + return $operador; + } + + public function multiOperador(array ...$elementAttributes): self + { + foreach ($elementAttributes as $attributes) { + $this->addOperador($attributes); + } + return $this; + } +} diff --git a/src/CfdiUtils/Elements/CartaPorte10/Origen.php b/src/CfdiUtils/Elements/CartaPorte10/Origen.php new file mode 100644 index 00000000..57cd91d9 --- /dev/null +++ b/src/CfdiUtils/Elements/CartaPorte10/Origen.php @@ -0,0 +1,13 @@ +helperGetOrAdd(new Domicilio()); + } + + public function addDomicilio(array $attributes = []): Domicilio + { + $domicilio = $this->getDomicilio(); + $domicilio->addAttributes($attributes); + + return $domicilio; + } +} diff --git a/src/CfdiUtils/Elements/CartaPorte10/Remolque.php b/src/CfdiUtils/Elements/CartaPorte10/Remolque.php new file mode 100644 index 00000000..a8b8e1d4 --- /dev/null +++ b/src/CfdiUtils/Elements/CartaPorte10/Remolque.php @@ -0,0 +1,13 @@ +addChild($remolque); + return $remolque; + } + + public function multiRemolque(array ...$elementAttributes): self + { + foreach ($elementAttributes as $attributes) { + $this->addRemolque($attributes); + } + return $this; + } +} diff --git a/src/CfdiUtils/Elements/CartaPorte10/TransporteAereo.php b/src/CfdiUtils/Elements/CartaPorte10/TransporteAereo.php new file mode 100644 index 00000000..1f51e6bf --- /dev/null +++ b/src/CfdiUtils/Elements/CartaPorte10/TransporteAereo.php @@ -0,0 +1,13 @@ +addChild($derechosDePaso); + + return $derechosDePaso; + } + + public function multiDerechosDePaso(array ...$elementAttributes): self + { + foreach ($elementAttributes as $attributes) { + $this->addDerechosDePaso($attributes); + } + return $this; + } + + public function addCarro(array $attributes = []): Carro + { + $carro = new Carro($attributes); + $this->addChild($carro); + + return $carro; + } + + public function multiCarro(array ...$elementAttributes): self + { + foreach ($elementAttributes as $attributes) { + $this->addCarro($attributes); + } + return $this; + } +} diff --git a/src/CfdiUtils/Elements/CartaPorte10/TransporteMaritimo.php b/src/CfdiUtils/Elements/CartaPorte10/TransporteMaritimo.php new file mode 100644 index 00000000..aee78a79 --- /dev/null +++ b/src/CfdiUtils/Elements/CartaPorte10/TransporteMaritimo.php @@ -0,0 +1,28 @@ +addChild($contenedores); + return $contenedores; + } + + public function multiContenedor(array ...$elementAttributes): self + { + foreach ($elementAttributes as $attributes) { + $this->addContenedor($attributes); + } + return $this; + } +} diff --git a/src/CfdiUtils/Elements/CartaPorte10/Ubicacion.php b/src/CfdiUtils/Elements/CartaPorte10/Ubicacion.php new file mode 100644 index 00000000..aecedf92 --- /dev/null +++ b/src/CfdiUtils/Elements/CartaPorte10/Ubicacion.php @@ -0,0 +1,60 @@ +helperGetOrAdd(new Origen()); + } + + public function addOrigen(array $attributes = []): Origen + { + $origen = $this->getOrigen(); + $origen->addAttributes($attributes); + + return $origen; + } + + public function getDestino(): Destino + { + /** @noinspection PhpIncompatibleReturnTypeInspection */ + return $this->helperGetOrAdd(new Destino()); + } + + public function addDestino(array $attributes = []): Destino + { + $destino = $this->getDestino(); + $destino->addAttributes($attributes); + + return $destino; + } + + public function getDomicilio(): Domicilio + { + /** @noinspection PhpIncompatibleReturnTypeInspection */ + return $this->helperGetOrAdd(new Domicilio()); + } + + public function addDomicilio(array $attributes = []): Domicilio + { + $domicilio = $this->getDomicilio(); + $domicilio->addAttributes($attributes); + + return $domicilio; + } +} diff --git a/src/CfdiUtils/Elements/CartaPorte10/Ubicaciones.php b/src/CfdiUtils/Elements/CartaPorte10/Ubicaciones.php new file mode 100644 index 00000000..6773a20c --- /dev/null +++ b/src/CfdiUtils/Elements/CartaPorte10/Ubicaciones.php @@ -0,0 +1,28 @@ +addChild($ubicacion); + return $ubicacion; + } + + public function multiUbicacion(array ...$elementAttributes): self + { + foreach ($elementAttributes as $attributes) { + $this->addUbicacion($attributes); + } + return $this; + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/ArrendatarioTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/ArrendatarioTest.php new file mode 100644 index 00000000..c93af776 --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/ArrendatarioTest.php @@ -0,0 +1,54 @@ +element = new Arrendatario(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:Arrendatario', $this->element->getElementName()); + } + + public function testGetDomicilio() + { + $this->assertCount(0, $this->element->searchNodes('cartaporte:Domicilio')); + + $first = $this->element->getDomicilio(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:Domicilio')); + + $second = $this->element->getDomicilio(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:Domicilio')); + + $this->assertSame($first, $second); + } + + public function testAddDomicilio() + { + // insert first element + $first = $this->element->addDomicilio(['id' => 'first']); + $this->assertInstanceOf(Domicilio::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return the same element + $second = $this->element->addDomicilio(['id' => 'second']); + $this->assertSame($first, $second); + $this->assertSame('second', $first['id']); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/AutotransporteFederalTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/AutotransporteFederalTest.php new file mode 100644 index 00000000..78fef43f --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/AutotransporteFederalTest.php @@ -0,0 +1,82 @@ +element = new AutotransporteFederal(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:AutotransporteFederal', $this->element->getElementName()); + } + + public function testGetIdentificacionVehicular() + { + $this->assertCount(0, $this->element->searchNodes('cartaporte:IdentificacionVehicular')); + + $first = $this->element->getIdentificacionVehicular(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:IdentificacionVehicular')); + + $second = $this->element->getIdentificacionVehicular(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:IdentificacionVehicular')); + + $this->assertSame($first, $second); + } + + public function testAddIdentificacionVehicular() + { + // insert first element + $first = $this->element->addIdentificacionVehicular(['id' => 'first']); + $this->assertInstanceOf(IdentificacionVehicular::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return a different element + $second = $this->element->addIdentificacionVehicular(['id' => 'second']); + $this->assertNotEquals($first, $second); + $this->assertCount(2, $this->element); + } + + public function testGetRemolques() + { + $this->assertCount(0, $this->element->searchNodes('cartaporte:Remolques')); + + $first = $this->element->getRemolques(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:Remolques')); + + $second = $this->element->getRemolques(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:Remolques')); + + $this->assertSame($first, $second); + } + + public function testAddRemolques() + { + // insert first element + $first = $this->element->addRemolques(['id' => 'first']); + $this->assertInstanceOf(Remolques::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return a different element + $second = $this->element->addRemolques(['id' => 'second']); + $this->assertNotEquals($first, $second); + $this->assertCount(2, $this->element); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/CantidadTransportaTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/CantidadTransportaTest.php new file mode 100644 index 00000000..f706b8fd --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/CantidadTransportaTest.php @@ -0,0 +1,26 @@ +element = new CantidadTransporta(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:CantidadTransporta', $this->element->getElementName()); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/CarroTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/CarroTest.php new file mode 100644 index 00000000..5cc96f98 --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/CarroTest.php @@ -0,0 +1,52 @@ +element = new Carro(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:Carro', $this->element->getElementName()); + } + + public function testAddContenedor() + { + // insert first element + $first = $this->element->addContenedor(['id' => 'first']); + $this->assertInstanceOf(Contenedor::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return a different element + $second = $this->element->addContenedor(['id' => 'second']); + $this->assertNotEquals($first, $second); + $this->assertCount(2, $this->element); + } + + public function testMultiContenedor() + { + // insert first element + $contenedores = $this->element->multiContenedor( + ['id' => 'first'], + ['id' => 'second'] + ); + $this->assertCount(2, $contenedores); + $this->assertSame($this->element, $contenedores); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/CartaPorteTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/CartaPorteTest.php new file mode 100644 index 00000000..021d61bf --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/CartaPorteTest.php @@ -0,0 +1,133 @@ +element = new CartaPorte(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:CartaPorte', $this->element->getElementName()); + } + + public function testChildrenOrder() + { + $expected = [ + 'cartaporte:Ubicaciones', + 'cartaporte:Mercancias', + 'cartaporte:FiguraTransporte', + ]; + $this->assertSame($expected, $this->element->getChildrenOrder()); + } + + public function testFixedVersion() + { + $this->assertSame('1.0', $this->element['Version']); + } + + public function testFixedNamespaceDefinition() + { + $namespace = 'http://www.sat.gob.mx/cartaporte'; + $this->assertSame($namespace, $this->element['xmlns:cartaporte']); + $xsdLocation = 'http://www.sat.gob.mx/sitio_internet/cfd/CartaPorte/CartaPorte.xsd'; + $this->assertSame($namespace . ' ' . $xsdLocation, $this->element['xsi:schemaLocation']); + } + + public function testGetUbicaciones() + { + $this->assertCount(0, $this->element->searchNodes('cartaporte:Ubicaciones')); + + $first = $this->element->getUbicaciones(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:Ubicaciones')); + + $second = $this->element->getUbicaciones(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:Ubicaciones')); + + $this->assertSame($first, $second); + } + + public function testAddUbicaciones() + { + // insert first element + $first = $this->element->addUbicaciones(['id' => 'first']); + $this->assertInstanceOf(Ubicaciones::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return the same element + $second = $this->element->addUbicaciones(['id' => 'second']); + $this->assertSame($first, $second); + $this->assertSame('second', $first['id']); + } + + public function testGetMercancias() + { + $this->assertCount(0, $this->element->searchNodes('cartaporte:Mercancias')); + + $first = $this->element->getMercancias(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:Mercancias')); + + $second = $this->element->getMercancias(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:Mercancias')); + + $this->assertSame($first, $second); + } + + public function testAddMercancias() + { + // insert first element + $first = $this->element->addMercancias(['id' => 'first']); + $this->assertInstanceOf(Mercancias::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return the same element + $second = $this->element->addMercancias(['id' => 'second']); + $this->assertSame($first, $second); + $this->assertSame('second', $first['id']); + } + + public function testGetFiguraTransporte() + { + $this->assertCount(0, $this->element->searchNodes('cartaporte:FiguraTransporte')); + + $first = $this->element->getFiguraTransporte(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:FiguraTransporte')); + + $second = $this->element->getFiguraTransporte(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:FiguraTransporte')); + + $this->assertSame($first, $second); + } + + public function testAddFiguraTransporte() + { + // insert first element + $first = $this->element->addFiguraTransporte(['id' => 'first']); + $this->assertInstanceOf(FiguraTransporte::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return the same element + $second = $this->element->addFiguraTransporte(['id' => 'second']); + $this->assertSame($first, $second); + $this->assertSame('second', $first['id']); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/ContenedorTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/ContenedorTest.php new file mode 100644 index 00000000..64ff4952 --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/ContenedorTest.php @@ -0,0 +1,26 @@ +element = new Contenedor(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:Contenedor', $this->element->getElementName()); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/DerechosDePasoTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/DerechosDePasoTest.php new file mode 100644 index 00000000..c342953d --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/DerechosDePasoTest.php @@ -0,0 +1,26 @@ +element = new DerechosDePaso(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:DerechosDePaso', $this->element->getElementName()); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/DestinoTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/DestinoTest.php new file mode 100644 index 00000000..6182ba32 --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/DestinoTest.php @@ -0,0 +1,26 @@ +element = new Destino(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:Destino', $this->element->getElementName()); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/DetalleMercanciaTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/DetalleMercanciaTest.php new file mode 100644 index 00000000..a66561b4 --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/DetalleMercanciaTest.php @@ -0,0 +1,26 @@ +element = new DetalleMercancia(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:DetalleMercancia', $this->element->getElementName()); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/DomicilioTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/DomicilioTest.php new file mode 100644 index 00000000..75481e19 --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/DomicilioTest.php @@ -0,0 +1,26 @@ +element = new Domicilio(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:Domicilio', $this->element->getElementName()); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/FiguraTransporteTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/FiguraTransporteTest.php new file mode 100644 index 00000000..8f575440 --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/FiguraTransporteTest.php @@ -0,0 +1,130 @@ +element = new FiguraTransporte(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:FiguraTransporte', $this->element->getElementName()); + } + + public function testAddOperadores() + { + // insert first element + $first = $this->element->addOperadores(['id' => 'first']); + $this->assertInstanceOf(Operadores::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return a different element + $second = $this->element->addOperadores(['id' => 'second']); + $this->assertNotEquals($first, $second); + $this->assertCount(2, $this->element); + } + + public function testMultiOperadores() + { + // insert first element + $operadores = $this->element->multiOperadores( + ['id' => 'first'], + ['id' => 'second'] + ); + $this->assertCount(2, $operadores); + $this->assertSame($this->element, $operadores); + } + + public function testAddPropietario() + { + // insert first element + $first = $this->element->addPropietario(['id' => 'first']); + $this->assertInstanceOf(Propietario::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return a different element + $second = $this->element->addPropietario(['id' => 'second']); + $this->assertNotEquals($first, $second); + $this->assertCount(2, $this->element); + } + + public function testMultiPropietario() + { + // insert first element + $propietario = $this->element->multiPropietario( + ['id' => 'first'], + ['id' => 'second'] + ); + $this->assertCount(2, $propietario); + $this->assertSame($this->element, $propietario); + } + + public function testAddArrendatario() + { + // insert first element + $first = $this->element->addArrendatario(['id' => 'first']); + $this->assertInstanceOf(Arrendatario::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return a different element + $second = $this->element->addArrendatario(['id' => 'second']); + $this->assertNotEquals($first, $second); + $this->assertCount(2, $this->element); + } + + public function testMultiArrendatario() + { + // insert first element + $arrendatario = $this->element->multiArrendatario( + ['id' => 'first'], + ['id' => 'second'] + ); + $this->assertCount(2, $arrendatario); + $this->assertSame($this->element, $arrendatario); + } + + public function testAddNotificado() + { + // insert first element + $first = $this->element->addNotificado(['id' => 'first']); + $this->assertInstanceOf(Notificado::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return a different element + $second = $this->element->addNotificado(['id' => 'second']); + $this->assertNotEquals($first, $second); + $this->assertCount(2, $this->element); + } + + public function testMultiNotificado() + { + // insert first element + $notificado = $this->element->multiNotificado( + ['id' => 'first'], + ['id' => 'second'] + ); + $this->assertCount(2, $notificado); + $this->assertSame($this->element, $notificado); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/IdentificacionVehicularTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/IdentificacionVehicularTest.php new file mode 100644 index 00000000..11aed073 --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/IdentificacionVehicularTest.php @@ -0,0 +1,26 @@ +element = new IdentificacionVehicular(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:IdentificacionVehicular', $this->element->getElementName()); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/MercanciaTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/MercanciaTest.php new file mode 100644 index 00000000..55538d09 --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/MercanciaTest.php @@ -0,0 +1,80 @@ +element = new Mercancia(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:Mercancia', $this->element->getElementName()); + } + + public function testAddCantidadTransporta() + { + // insert first element + $first = $this->element->addCantidadTransporta(['id' => 'first']); + $this->assertInstanceOf(CantidadTransporta::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return a different element + $second = $this->element->addCantidadTransporta(['id' => 'second']); + $this->assertNotEquals($first, $second); + $this->assertCount(2, $this->element); + } + + public function testMultiCantidadTransporta() + { + // insert first element + $cantidadTransportaNodes = $this->element->multiCantidadTransporta( + ['id' => 'first'], + ['id' => 'second'] + ); + $this->assertCount(2, $cantidadTransportaNodes); + $this->assertSame($this->element, $cantidadTransportaNodes); + } + + public function testGetDetalleMercancia() + { + $this->assertCount(0, $this->element->searchNodes('cartaporte:DetalleMercancia')); + + $first = $this->element->getDetalleMercancia(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:DetalleMercancia')); + + $second = $this->element->getDetalleMercancia(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:DetalleMercancia')); + + $this->assertSame($first, $second); + } + + public function testAddDetalleMercancia() + { + // insert first element + $first = $this->element->addDetalleMercancia(['id' => 'first']); + $this->assertInstanceOf(DetalleMercancia::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return a different element + $second = $this->element->addDetalleMercancia(['id' => 'second']); + $this->assertNotEquals($first, $second); + $this->assertCount(2, $this->element); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/MercanciasTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/MercanciasTest.php new file mode 100644 index 00000000..cacef556 --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/MercanciasTest.php @@ -0,0 +1,112 @@ +element = new Mercancias(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:Mercancias', $this->element->getElementName()); + } + + public function testAddMercancia() + { + // insert first element + $first = $this->element->addMercancia(['id' => 'first']); + $this->assertInstanceOf(Mercancia::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return a different element + $second = $this->element->addMercancia(['id' => 'second']); + $this->assertNotEquals($first, $second); + $this->assertCount(2, $this->element); + } + + public function testMultiMercancia() + { + // insert first element + $mercancias = $this->element->multiMercancia( + ['id' => 'first'], + ['id' => 'second'] + ); + $this->assertCount(2, $mercancias); + $this->assertSame($this->element, $mercancias); + } + + public function testAddAutotransporteFederal() + { + // insert first element + $first = $this->element->addAutotransporteFederal(['id' => 'first']); + $this->assertInstanceOf(AutotransporteFederal::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return a different element + $second = $this->element->addAutotransporteFederal(['id' => 'second']); + $this->assertNotEquals($first, $second); + $this->assertCount(2, $this->element); + } + + public function testAddTransporteMaritimo() + { + // insert first element + $first = $this->element->addTransporteMaritimo(['id' => 'first']); + $this->assertInstanceOf(TransporteMaritimo::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return a different element + $second = $this->element->addTransporteMaritimo(['id' => 'second']); + $this->assertNotEquals($first, $second); + $this->assertCount(2, $this->element); + } + + public function testAddTransporteAereo() + { + // insert first element + $first = $this->element->addTransporteAereo(['id' => 'first']); + $this->assertInstanceOf(TransporteAereo::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return a different element + $second = $this->element->addTransporteAereo(['id' => 'second']); + $this->assertNotEquals($first, $second); + $this->assertCount(2, $this->element); + } + + public function testAddTransporteFerroviario() + { + // insert first element + $first = $this->element->addTransporteFerroviario(['id' => 'first']); + $this->assertInstanceOf(TransporteFerroviario::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return a different element + $second = $this->element->addTransporteFerroviario(['id' => 'second']); + $this->assertNotEquals($first, $second); + $this->assertCount(2, $this->element); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/NotificadoTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/NotificadoTest.php new file mode 100644 index 00000000..33389808 --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/NotificadoTest.php @@ -0,0 +1,26 @@ +element = new Notificado(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:Notificado', $this->element->getElementName()); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/OperadorTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/OperadorTest.php new file mode 100644 index 00000000..56a5418d --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/OperadorTest.php @@ -0,0 +1,54 @@ +element = new Operador(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:Operador', $this->element->getElementName()); + } + + public function testGetDomicilio() + { + $this->assertCount(0, $this->element->searchNodes('cartaporte:Domicilio')); + + $first = $this->element->getDomicilio(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:Domicilio')); + + $second = $this->element->getDomicilio(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:Domicilio')); + + $this->assertSame($first, $second); + } + + public function testAddDomicilio() + { + // insert first element + $first = $this->element->addDomicilio(['id' => 'first']); + $this->assertInstanceOf(Domicilio::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return the same element + $second = $this->element->addDomicilio(['id' => 'second']); + $this->assertSame($first, $second); + $this->assertSame('second', $first['id']); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/OperadoresTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/OperadoresTest.php new file mode 100644 index 00000000..a0f61ded --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/OperadoresTest.php @@ -0,0 +1,52 @@ +element = new Operadores(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:Operadores', $this->element->getElementName()); + } + + public function testAddOperador() + { + // insert first element + $first = $this->element->addOperador(['id' => 'first']); + $this->assertInstanceOf(Operador::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return a different element + $second = $this->element->addOperador(['id' => 'second']); + $this->assertNotEquals($first, $second); + $this->assertCount(2, $this->element); + } + + public function testMultiOperador() + { + // insert first element + $operadores = $this->element->multiOperador( + ['id' => 'first'], + ['id' => 'second'] + ); + $this->assertCount(2, $operadores); + $this->assertSame($this->element, $operadores); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/OrigenTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/OrigenTest.php new file mode 100644 index 00000000..d08df8b1 --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/OrigenTest.php @@ -0,0 +1,26 @@ +element = new Origen(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:Origen', $this->element->getElementName()); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/PropietarioTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/PropietarioTest.php new file mode 100644 index 00000000..7a42e0e3 --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/PropietarioTest.php @@ -0,0 +1,54 @@ +element = new Propietario(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:Propietario', $this->element->getElementName()); + } + + public function testGetDomicilio() + { + $this->assertCount(0, $this->element->searchNodes('cartaporte:Domicilio')); + + $first = $this->element->getDomicilio(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:Domicilio')); + + $second = $this->element->getDomicilio(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:Domicilio')); + + $this->assertSame($first, $second); + } + + public function testAddDomicilio() + { + // insert first element + $first = $this->element->addDomicilio(['id' => 'first']); + $this->assertInstanceOf(Domicilio::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return the same element + $second = $this->element->addDomicilio(['id' => 'second']); + $this->assertSame($first, $second); + $this->assertSame('second', $first['id']); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/RemolqueTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/RemolqueTest.php new file mode 100644 index 00000000..866f47df --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/RemolqueTest.php @@ -0,0 +1,26 @@ +element = new Remolque(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:Remolque', $this->element->getElementName()); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/RemolquesTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/RemolquesTest.php new file mode 100644 index 00000000..6faf64c5 --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/RemolquesTest.php @@ -0,0 +1,52 @@ +element = new Remolques(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:Remolques', $this->element->getElementName()); + } + + public function testAddRemolque() + { + // insert first element + $first = $this->element->addRemolque(['id' => 'first']); + $this->assertInstanceOf(Remolque::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return a different element + $second = $this->element->addRemolque(['id' => 'second']); + $this->assertNotEquals($first, $second); + $this->assertCount(2, $this->element); + } + + public function testMultiRemolque() + { + // insert first element + $remolque = $this->element->multiRemolque( + ['id' => 'first'], + ['id' => 'second'] + ); + $this->assertCount(2, $remolque); + $this->assertSame($this->element, $remolque); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/TransporteAereoTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/TransporteAereoTest.php new file mode 100644 index 00000000..3b0c5f21 --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/TransporteAereoTest.php @@ -0,0 +1,26 @@ +element = new TransporteAereo(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:TransporteAereo', $this->element->getElementName()); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/TransporteFerroviarioTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/TransporteFerroviarioTest.php new file mode 100644 index 00000000..b02576f7 --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/TransporteFerroviarioTest.php @@ -0,0 +1,78 @@ +element = new TransporteFerroviario(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:TransporteFerroviario', $this->element->getElementName()); + } + + public function testAddDerechosDePaso() + { + // insert first element + $first = $this->element->addDerechosDePaso(['id' => 'first']); + $this->assertInstanceOf(DerechosDePaso::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return a different element + $second = $this->element->addDerechosDePaso(['id' => 'second']); + $this->assertNotEquals($first, $second); + $this->assertCount(2, $this->element); + } + + public function testMultiDerechosDePaso() + { + // insert first element + $derechosDePaso = $this->element->multiDerechosDePaso( + ['id' => 'first'], + ['id' => 'second'] + ); + $this->assertCount(2, $derechosDePaso); + $this->assertSame($this->element, $derechosDePaso); + } + + public function testAddCarro() + { + // insert first element + $first = $this->element->addCarro(['id' => 'first']); + $this->assertInstanceOf(Carro::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return a different element + $second = $this->element->addCarro(['id' => 'second']); + $this->assertNotEquals($first, $second); + $this->assertCount(2, $this->element); + } + + public function testMultiCarro() + { + // insert first element + $carros = $this->element->multiCarro( + ['id' => 'first'], + ['id' => 'second'] + ); + $this->assertCount(2, $carros); + $this->assertSame($this->element, $carros); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/TransporteMaritimoTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/TransporteMaritimoTest.php new file mode 100644 index 00000000..8d32ea5f --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/TransporteMaritimoTest.php @@ -0,0 +1,52 @@ +element = new TransporteMaritimo(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:TransporteMaritimo', $this->element->getElementName()); + } + + public function testAddContenedor() + { + // insert first element + $first = $this->element->addContenedor(['id' => 'first']); + $this->assertInstanceOf(Contenedor::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return a different element + $second = $this->element->addContenedor(['id' => 'second']); + $this->assertNotEquals($first, $second); + $this->assertCount(2, $this->element); + } + + public function testMultiContenedor() + { + // insert first element + $contenedores = $this->element->multiContenedor( + ['id' => 'first'], + ['id' => 'second'] + ); + $this->assertCount(2, $contenedores); + $this->assertSame($this->element, $contenedores); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/UbicacionTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/UbicacionTest.php new file mode 100644 index 00000000..1a63ba22 --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/UbicacionTest.php @@ -0,0 +1,116 @@ +element = new Ubicacion(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:Ubicacion', $this->element->getElementName()); + } + + public function testChildrenOrder() + { + $expected = ['cartaporte:Origen', 'cartaporte:Destino', 'cartaporte:Domicilio']; + $this->assertSame($expected, $this->element->getChildrenOrder()); + } + + public function testGetOrigen() + { + $this->assertCount(0, $this->element->searchNodes('cartaporte:Origen')); + + $first = $this->element->getOrigen(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:Origen')); + + $second = $this->element->getOrigen(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:Origen')); + + $this->assertSame($first, $second); + } + + public function testAddOrigen() + { + // insert first element + $first = $this->element->addOrigen(['id' => 'first']); + $this->assertInstanceOf(Origen::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return the same element + $second = $this->element->addOrigen(['id' => 'second']); + $this->assertSame($first, $second); + $this->assertSame('second', $first['id']); + } + + public function testGetDestino() + { + $this->assertCount(0, $this->element->searchNodes('cartaporte:Destino')); + + $first = $this->element->getDestino(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:Destino')); + + $second = $this->element->getDestino(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:Destino')); + + $this->assertSame($first, $second); + } + + public function testAddDestino() + { + // insert first element + $first = $this->element->addDestino(['id' => 'first']); + $this->assertInstanceOf(Destino::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return the same element + $second = $this->element->addDestino(['id' => 'second']); + $this->assertSame($first, $second); + $this->assertSame('second', $first['id']); + } + + public function testGetDomicilio() + { + $this->assertCount(0, $this->element->searchNodes('cartaporte:Domicilio')); + + $first = $this->element->getDomicilio(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:Domicilio')); + + $second = $this->element->getDomicilio(); + $this->assertCount(1, $this->element->searchNodes('cartaporte:Domicilio')); + + $this->assertSame($first, $second); + } + + public function testAddDomicilio() + { + // insert first element + $first = $this->element->addDomicilio(['id' => 'first']); + $this->assertInstanceOf(Domicilio::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return the same element + $second = $this->element->addDomicilio(['id' => 'second']); + $this->assertSame($first, $second); + $this->assertSame('second', $first['id']); + } +} diff --git a/tests/CfdiUtilsTests/Elements/CartaPorte10/UbicacionesTest.php b/tests/CfdiUtilsTests/Elements/CartaPorte10/UbicacionesTest.php new file mode 100644 index 00000000..5fdc32f2 --- /dev/null +++ b/tests/CfdiUtilsTests/Elements/CartaPorte10/UbicacionesTest.php @@ -0,0 +1,52 @@ +element = new Ubicaciones(); + } + + public function testConstructedObject() + { + $this->assertSame('cartaporte:Ubicaciones', $this->element->getElementName()); + } + + public function testAddUbicacion() + { + // insert first element + $first = $this->element->addUbicacion(['id' => 'first']); + $this->assertInstanceOf(Ubicacion::class, $first); + $this->assertSame('first', $first['id']); + $this->assertCount(1, $this->element); + + // insert second element data should return a different element + $second = $this->element->addUbicacion(['id' => 'second']); + $this->assertNotEquals($first, $second); + $this->assertCount(2, $this->element); + } + + public function testMultiUbicacion() + { + // insert first element + $ubicaciones = $this->element->multiUbicacion( + ['id' => 'first'], + ['id' => 'second'] + ); + $this->assertCount(2, $ubicaciones); + $this->assertSame($this->element, $ubicaciones); + } +}