Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/Dto/DpsData.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,6 @@ public function __construct(
/** Whether the provider opts into Simples Nacional. */
public int $opcaoSimplesNacional = 1,

/**
* Regime de apuração do Simples Nacional (regApTribSN).
* Required by E0166 for ME/EPP (opSimpNac=3), otherwise absent.
* 1: federal and ISS via SN; 2: federal SN, ISS outside SN;
* 3: federal and ISS outside SN.
*/
public ?int $regimeApuracaoSimplesNacional = null,

/** Regime especial de tributação. */
public int $regimeEspecialTributacao = 0,

Expand Down Expand Up @@ -230,6 +222,14 @@ public function __construct(

/** Optional municipal benefit identified by the official municipal parameter id. */
public ?MunicipalBenefitData $beneficioMunicipal = null,

/**
* Regime de apuração do Simples Nacional (regApTribSN).
* Required by E0166 for ME/EPP (opSimpNac=3), otherwise absent.
* 1: federal and ISS via SN; 2: federal SN, ISS outside SN;
* 3: federal and ISS outside SN.
*/
public ?int $regimeApuracaoSimplesNacional = null,
) {
}
}
12 changes: 12 additions & 0 deletions tests/Unit/Xml/XmlBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ public function testProviderMunicipalRegistrationRejectsOversizedValueBeforeXmlI
$this->builder->buildDps($this->makeDps(prestadorInscricaoMunicipal: str_repeat('1', 16)));
}

public function testExtendedDtoKeepsLegacyPositionalConstructorOrder(): void
{
$parameters = (new \ReflectionMethod(DpsData::class, '__construct'))->getParameters();
$names = array_map(static fn (\ReflectionParameter $parameter): string => $parameter->getName(), $parameters);

self::assertSame('regimeApuracaoSimplesNacional', $names[count($names) - 1]);
self::assertLessThan(
array_search('regimeApuracaoSimplesNacional', $names, true),
array_search('regimeEspecialTributacao', $names, true),
);
}

public function testMeEppWithoutApurationIsRejectedBeforeXmlGeneration(): void
{
$this->expectException(\InvalidArgumentException::class);
Expand Down
Loading