From 1692158d7a87fe3a924b0d755c97f88e40fa8a14 Mon Sep 17 00:00:00 2001 From: Antonio Spinelli Date: Wed, 23 Mar 2022 00:21:15 -0300 Subject: [PATCH] Get the static code analysis back (#49) A misconfiguration stopped the code analysis, and the PHP8 version broke the tests because the test code didn't respect the typehint. So, the Scrutinizer and Codacy are established and working. Now is possible to get metrics about the project --- .scrutinizer.yml | 31 +++-- README.md | 10 +- composer.json | 2 +- src/DigitCalculator.php | 2 +- src/JudiciaryProcess.php | 4 +- src/StateRegistration/Amapa.php | 2 +- src/StateRegistration/Goias.php | 2 +- tests/CnhTest.php | 3 - tests/CnpjTest.php | 3 - tests/CnsTest.php | 3 - tests/CpfTest.php | 3 - tests/JudiciaryProcessTest.php | 3 - tests/PisPasepTest.php | 3 - tests/RenavamTest.php | 1 - tests/Sped/CTeTest.php | 2 +- tests/Sped/MDFeTest.php | 4 +- tests/Sped/NFCeTest.php | 2 +- tests/StateRegistration/AcreTest.php | 3 - tests/StateRegistration/AlagoasTest.php | 4 +- tests/StateRegistration/AmapaTest.php | 4 +- tests/StateRegistration/AmazonasTest.php | 4 +- tests/StateRegistration/BahiaTest.php | 14 +-- tests/StateRegistration/CearaTest.php | 2 +- .../StateRegistration/DistritoFederalTest.php | 4 +- tests/StateRegistration/EspiritoSantoTest.php | 2 +- tests/StateRegistration/GoiasTest.php | 2 +- tests/StateRegistration/MaranhaoTest.php | 2 +- tests/StateRegistration/MatoGrossoSulTest.php | 3 +- tests/StateRegistration/MatoGrossoTest.php | 107 +++++++++--------- tests/StateRegistration/MinasGeraisTest.php | 3 +- tests/StateRegistration/ParaTest.php | 1 + tests/StateRegistration/ParaibaTest.php | 1 + tests/StateRegistration/PernambucoTest.php | 1 + tests/StateRegistration/PiauiTest.php | 1 + tests/StateRegistration/RioDeJaneiroTest.php | 3 +- .../RioGrandeDoNorteTest.php | 1 + .../StateRegistration/RioGrandeDoSulTest.php | 1 + tests/StateRegistration/RondoniaTest.php | 1 + tests/StateRegistration/RoraimaTest.php | 1 + tests/StateRegistration/SantaCatarinaTest.php | 1 + tests/StateRegistration/SaoPauloTest.php | 1 + tests/StateRegistration/SergipeTest.php | 1 + tests/StateRegistration/TocantinsTest.php | 1 + tests/VoterTest.php | 3 - 44 files changed, 121 insertions(+), 131 deletions(-) diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 1ee39d6..a38b416 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -24,20 +24,29 @@ tools: build: dependencies: - before: - - "sudo composer self-update" override: - "composer install --no-interaction --prefer-dist" - tests: - override: - - - command: './vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover=clover.xml' - coverage: - file: 'clover.xml' - format: 'php-clover' + nodes: + analysis: + tests: + override: + - php-scrutinizer-run + + coverage: + environment: + php: + ini: + "xdebug.mode": coverage + tests: + override: + - + command: './vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover=clover.xml' + coverage: + file: 'clover.xml' + format: 'php-clover' environment: php: - version: 7.0.8 + version: 8 mysql: false postgresql: false redis: false @@ -45,4 +54,4 @@ build: rabbitmq: false mongodb: false neo4j: false - memcached: false \ No newline at end of file + memcached: false diff --git a/README.md b/README.md index a8bc996..38e2af1 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ Brazanation Documents ===================== -[![Build Status](https://travis-ci.org/brazanation/php-documents.svg?branch=master)](https://travis-ci.org/brazanation/php-documents) -[![Codacy Badge](https://api.codacy.com/project/badge/Grade/0bdf934bc4224a9fb9d51dc9162fb000)](https://www.codacy.com/app/tonicospinelli/php-documents?utm_source=github.com&utm_medium=referral&utm_content=brazanation/php-documents&utm_campaign=Badge_Grade) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/brazanation/php-documents/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/brazanation/php-documents/?branch=master) -[![Code Coverage](https://scrutinizer-ci.com/g/brazanation/php-documents/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/brazanation/php-documents/?branch=master) -[![StyleCI](https://styleci.io/repos/66179431/shield)](https://styleci.io/repos/66179431) +[![Build Status](https://scrutinizer-ci.com/g/brazanation/php-documents/badges/build.png?b=main)](https://scrutinizer-ci.com/g/brazanation/php-documents/build-status/main) +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/f8c31359fca64c0c9c8375182fbceefd)](https://www.codacy.com/gh/brazanation/php-documents/dashboard?utm_source=github.com&utm_medium=referral&utm_content=brazanation/php-documents&utm_campaign=Badge_Grade) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/brazanation/php-documents/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/brazanation/php-documents/?branch=main) +[![Code Coverage](https://scrutinizer-ci.com/g/brazanation/php-documents/badges/coverage.png?b=main)](https://scrutinizer-ci.com/g/brazanation/php-documents/?branch=main) +[![StyleCI](https://github.styleci.io/repos/66179431/shield?branch=main)](https://github.styleci.io/repos/66179431?branch=main) A PHP library to provide Brazilian Documents safer, easier and fun! diff --git a/composer.json b/composer.json index 42dd02c..a0bd2d0 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "php": ">=7.0" }, "require-dev": { - "phpunit/phpunit": "^6.4", + "phpunit/phpunit": "^9.5", "codacy/coverage": "^1.0" }, "license": "MIT", diff --git a/src/DigitCalculator.php b/src/DigitCalculator.php index f0d09b9..639c2a3 100644 --- a/src/DigitCalculator.php +++ b/src/DigitCalculator.php @@ -273,7 +273,7 @@ private function calculateAdditionalDigit(string $digit) : int private function calculateSingleSum(int $total) : int { if ($this->singleSum) { - return intval(($total / 10) + ($total % 10)); + return (int) (($total / 10) + ($total % 10)); } return $total; diff --git a/src/JudiciaryProcess.php b/src/JudiciaryProcess.php index d25aed7..ca0bea6 100644 --- a/src/JudiciaryProcess.php +++ b/src/JudiciaryProcess.php @@ -118,11 +118,11 @@ protected function extractBaseNumber(string $number) : string */ public function calculateDigit(string $input) : string { - $remainderNumber = intval($this->sequentialNumber) % 97; + $remainderNumber = (int) $this->sequentialNumber % 97; $judiciaryNumber = "{$remainderNumber}{$this->year}{$this->judiciary}{$this->court}"; - $remainderJudiciary = intval($judiciaryNumber) % 97; + $remainderJudiciary = (int) $judiciaryNumber % 97; $originNumber = "{$remainderJudiciary}{$this->origin}00"; $remainder = (float) $originNumber % 97; diff --git a/src/StateRegistration/Amapa.php b/src/StateRegistration/Amapa.php index a317909..a2f2f16 100644 --- a/src/StateRegistration/Amapa.php +++ b/src/StateRegistration/Amapa.php @@ -30,7 +30,7 @@ public function __construct() */ public function calculateDigit(string $baseNumber) : string { - $number = intval($baseNumber); + $number = (int) $baseNumber; $lastDigit = $this->discoverLastDigit($number); $digitToReplace = $this->discoverDigitToReplace($number); diff --git a/src/StateRegistration/Goias.php b/src/StateRegistration/Goias.php index 56bdd1c..5f9d602 100644 --- a/src/StateRegistration/Goias.php +++ b/src/StateRegistration/Goias.php @@ -48,7 +48,7 @@ private function setCurrentDigit(string $digit) */ public function calculateDigit(string $baseNumber) : string { - $digitToReplace = $this->discoverDigitToReplace(intval($baseNumber)); + $digitToReplace = $this->discoverDigitToReplace((int) $baseNumber); $calculator = new DigitCalculator($baseNumber); $calculator->useComplementaryInsteadOfModule(); diff --git a/tests/CnhTest.php b/tests/CnhTest.php index d0ab911..5f25598 100644 --- a/tests/CnhTest.php +++ b/tests/CnhTest.php @@ -36,15 +36,12 @@ public function provideEmptyData() : array { return [ [Cnh::LABEL, ''], - [Cnh::LABEL, null], - [Cnh::LABEL, 0], ]; } public function provideInvalidNumber() : array { return [ - [Cnh::LABEL, 1], [Cnh::LABEL, '11111111111'], [Cnh::LABEL, '06843273172'], ]; diff --git a/tests/CnpjTest.php b/tests/CnpjTest.php index 2c97ec5..7e64dbc 100644 --- a/tests/CnpjTest.php +++ b/tests/CnpjTest.php @@ -37,15 +37,12 @@ public function provideEmptyData() : array { return [ [Cnpj::LABEL, ''], - [Cnpj::LABEL, null], - [Cnpj::LABEL, 0], ]; } public function provideInvalidNumber() : array { return [ - [Cnpj::LABEL, 1], [Cnpj::LABEL, '11111111111111'], [Cnpj::LABEL, '00111222100099'], [Cnpj::LABEL, '00.111.222/1000-99'], diff --git a/tests/CnsTest.php b/tests/CnsTest.php index 1f03790..4201feb 100644 --- a/tests/CnsTest.php +++ b/tests/CnsTest.php @@ -42,15 +42,12 @@ public function provideEmptyData() : array { return [ [Cns::LABEL, ''], - [Cns::LABEL, null], - [Cns::LABEL, 0], ]; } public function provideInvalidNumber() : array { return [ - [Cns::LABEL, 1], [Cns::LABEL, '123123232323'], [Cns::LABEL, '861238979874'], ]; diff --git a/tests/CpfTest.php b/tests/CpfTest.php index 0844552..3a4df1e 100644 --- a/tests/CpfTest.php +++ b/tests/CpfTest.php @@ -37,15 +37,12 @@ public function provideEmptyData() : array { return [ [Cpf::LABEL, ''], - [Cpf::LABEL, null], - [Cpf::LABEL, 0], ]; } public function provideInvalidNumber() : array { return [ - [Cpf::LABEL, 1], [Cpf::LABEL, '11111111111'], [Cpf::LABEL, '06843273172'], [Cpf::LABEL, '068.432.731-72'], diff --git a/tests/JudiciaryProcessTest.php b/tests/JudiciaryProcessTest.php index ab45c6c..1962041 100644 --- a/tests/JudiciaryProcessTest.php +++ b/tests/JudiciaryProcessTest.php @@ -37,15 +37,12 @@ public function provideEmptyData() : array { return [ [JudiciaryProcess::LABEL, ''], - [JudiciaryProcess::LABEL, null], - [JudiciaryProcess::LABEL, 0], ]; } public function provideInvalidNumber() : array { return [ - [JudiciaryProcess::LABEL, 1], [JudiciaryProcess::LABEL, '11111111111111'], [JudiciaryProcess::LABEL, '00111222100099'], [JudiciaryProcess::LABEL, '00.111.222/1000-99'], diff --git a/tests/PisPasepTest.php b/tests/PisPasepTest.php index b94d59e..dda8e2f 100644 --- a/tests/PisPasepTest.php +++ b/tests/PisPasepTest.php @@ -37,15 +37,12 @@ public function provideEmptyData() : array { return [ [PisPasep::LABEL, ''], - [PisPasep::LABEL, null], - [PisPasep::LABEL, 0], ]; } public function provideInvalidNumber() : array { return [ - [PisPasep::LABEL, 1], [PisPasep::LABEL, '11111111111'], [PisPasep::LABEL, '51823129492'], [PisPasep::LABEL, '51.82312.94-92'], diff --git a/tests/RenavamTest.php b/tests/RenavamTest.php index 104f07f..e00a19f 100644 --- a/tests/RenavamTest.php +++ b/tests/RenavamTest.php @@ -37,7 +37,6 @@ public function provideEmptyData() : array { return [ [Renavam::LABEL, ''], - [Renavam::LABEL, null], ]; } diff --git a/tests/Sped/CTeTest.php b/tests/Sped/CTeTest.php index 7a7f0ed..daa82f5 100644 --- a/tests/Sped/CTeTest.php +++ b/tests/Sped/CTeTest.php @@ -83,7 +83,7 @@ public function testGenerateAValidNumber() $this->assertEquals('33009911002506', "{$nfeKey->cnpj}", 'Failed assert for CNPJ'); $this->assertEquals('57', "{$nfeKey->model}", 'Failed assert for model'); $this->assertEquals('012', $nfeKey->sequence, 'Failed assert for sequence'); - $this->assertEquals('00000780', $nfeKey->invoiceNumber, 'Failed assert for invoice number'); + $this->assertEquals('000000780', $nfeKey->invoiceNumber, 'Failed assert for invoice number'); $this->assertEquals(EmissionType::NORMAL, "{$nfeKey->emissionType}", 'Failed assert for emission type'); $this->assertEquals('26730161', $nfeKey->controlNumber, 'Failed assert for digit'); $this->assertEquals('52060433009911002506570120000007801267301610', "{$nfeKey}"); diff --git a/tests/Sped/MDFeTest.php b/tests/Sped/MDFeTest.php index a77cc81..bc5babf 100644 --- a/tests/Sped/MDFeTest.php +++ b/tests/Sped/MDFeTest.php @@ -82,8 +82,8 @@ public function testGenerateAValidNumber() $this->assertEquals($generatedAt, $nfeKey->generatedAt, 'Failed assert for generatedAt'); $this->assertEquals('33009911002506', "{$nfeKey->cnpj}", 'Failed assert for CNPJ'); $this->assertEquals(Model::TYPE_MDFE, "{$nfeKey->model}", 'Failed assert for model'); - $this->assertEquals('000000012', $nfeKey->sequence, 'Failed assert for sequence'); - $this->assertEquals('00000780', $nfeKey->invoiceNumber, 'Failed assert for invoice number'); + $this->assertEquals('012', $nfeKey->sequence, 'Failed assert for sequence'); + $this->assertEquals('000000780', $nfeKey->invoiceNumber, 'Failed assert for invoice number'); $this->assertEquals(EmissionType::NORMAL, "{$nfeKey->emissionType}", 'Failed assert for emission type'); $this->assertEquals('26730161', $nfeKey->controlNumber, 'Failed assert for digit'); $this->assertEquals('52060433009911002506580120000007801267301614', "{$nfeKey}"); diff --git a/tests/Sped/NFCeTest.php b/tests/Sped/NFCeTest.php index 32944dc..a28a1ee 100644 --- a/tests/Sped/NFCeTest.php +++ b/tests/Sped/NFCeTest.php @@ -86,7 +86,7 @@ public function testGenerateAValidNumber() $this->assertEquals('012', $nfeKey->sequence, 'Failed assert for sequence'); $this->assertEquals('000000780', $nfeKey->invoiceNumber, 'Failed assert for invoice number'); $this->assertEquals(EmissionType::CONTINGENCY_ON_SAFETY_FORM, "{$nfeKey->emissionType}", 'Failed assert for emission type'); - $this->assertEquals('006730161', $nfeKey->controlNumber, 'Failed assert for digit'); + $this->assertEquals('06730161', $nfeKey->controlNumber, 'Failed assert for digit'); $this->assertEquals('52060433009911002506650120000007802067301610', "{$nfeKey}"); } } diff --git a/tests/StateRegistration/AcreTest.php b/tests/StateRegistration/AcreTest.php index 1a224ad..2a4b4bb 100644 --- a/tests/StateRegistration/AcreTest.php +++ b/tests/StateRegistration/AcreTest.php @@ -37,15 +37,12 @@ public function provideEmptyData() : array { return [ [Acre::LONG_NAME, ''], - [Acre::LONG_NAME, null], - [Acre::LONG_NAME, 0], ]; } public function provideInvalidNumber() : array { return [ - [Acre::LONG_NAME, 1], [Acre::LONG_NAME, '0100482300113'], ]; } diff --git a/tests/StateRegistration/AlagoasTest.php b/tests/StateRegistration/AlagoasTest.php index 607379f..61c3bb6 100644 --- a/tests/StateRegistration/AlagoasTest.php +++ b/tests/StateRegistration/AlagoasTest.php @@ -44,14 +44,14 @@ public function provideValidNumbersAndExpectedFormat() : array public function provideEmptyData() : array { return [ - [Alagoas::LONG_NAME, 0], + [Alagoas::LONG_NAME, ''], ]; } public function provideInvalidNumber() : array { return [ - [Alagoas::LONG_NAME, 1], + [Alagoas::LONG_NAME, '1'], [Alagoas::LONG_NAME, '0100482300113'], ]; } diff --git a/tests/StateRegistration/AmapaTest.php b/tests/StateRegistration/AmapaTest.php index 9571d96..7b7c5de 100644 --- a/tests/StateRegistration/AmapaTest.php +++ b/tests/StateRegistration/AmapaTest.php @@ -37,14 +37,14 @@ public function provideValidNumbersAndExpectedFormat() : array public function provideEmptyData() : array { return [ - [Amapa::LONG_NAME, 0], + [Amapa::LONG_NAME, ''], ]; } public function provideInvalidNumber() : array { return [ - [Amapa::LONG_NAME, 1], + [Amapa::LONG_NAME, '1'], [Amapa::LONG_NAME, '03.012.345-8'], ]; } diff --git a/tests/StateRegistration/AmazonasTest.php b/tests/StateRegistration/AmazonasTest.php index b82080e..9de0190 100644 --- a/tests/StateRegistration/AmazonasTest.php +++ b/tests/StateRegistration/AmazonasTest.php @@ -40,14 +40,14 @@ public function provideValidNumbersAndExpectedFormat() : array public function provideEmptyData() : array { return [ - [Amazonas::LONG_NAME, 0], + [Amazonas::LONG_NAME, ''], ]; } public function provideInvalidNumber() : array { return [ - [Amazonas::LONG_NAME, 1], + [Amazonas::LONG_NAME, '1'], [Amazonas::LONG_NAME, '03.012.345-8'], ]; } diff --git a/tests/StateRegistration/BahiaTest.php b/tests/StateRegistration/BahiaTest.php index d8fa066..0cd95b0 100644 --- a/tests/StateRegistration/BahiaTest.php +++ b/tests/StateRegistration/BahiaTest.php @@ -22,17 +22,17 @@ public function createDocumentFromString(string $number) public function provideValidNumbers() : array { return [ - ['123456-63'], + ['0123456-63'], ['1000003-06'], ['1057652-04'], ['0635718-30'], - ['770288-84'], + ['0770288-84'], ['077.028.884'], ['085456408'], - ['78215597'], - ['75467384'], - ['45564835'], - ['01314209'], + ['078215597'], + ['075467384'], + ['045564835'], + ['001314209'], ['111568918'], ['039681030'] ]; @@ -49,7 +49,7 @@ public function provideValidNumbersAndExpectedFormat() : array public function provideEmptyData() : array { return [ - [Bahia::LONG_NAME, 0], + [Bahia::LONG_NAME, ''], ]; } diff --git a/tests/StateRegistration/CearaTest.php b/tests/StateRegistration/CearaTest.php index 79834db..b6f912d 100644 --- a/tests/StateRegistration/CearaTest.php +++ b/tests/StateRegistration/CearaTest.php @@ -40,7 +40,7 @@ public function provideValidNumbersAndExpectedFormat() : array public function provideEmptyData() : array { return [ - [Ceara::LONG_NAME, 0], + [Ceara::LONG_NAME, ''], ]; } diff --git a/tests/StateRegistration/DistritoFederalTest.php b/tests/StateRegistration/DistritoFederalTest.php index bb0da92..bc43f07 100644 --- a/tests/StateRegistration/DistritoFederalTest.php +++ b/tests/StateRegistration/DistritoFederalTest.php @@ -42,15 +42,13 @@ public function provideEmptyData() : array { return [ [DF::LONG_NAME, ''], - [DF::LONG_NAME, null], - [DF::LONG_NAME, 0], ]; } public function provideInvalidNumber() : array { return [ - [DF::LONG_NAME, 1], + [DF::LONG_NAME, '1'], [DF::LONG_NAME, '0756855600125'], ]; } diff --git a/tests/StateRegistration/EspiritoSantoTest.php b/tests/StateRegistration/EspiritoSantoTest.php index 5acd71a..84fe315 100644 --- a/tests/StateRegistration/EspiritoSantoTest.php +++ b/tests/StateRegistration/EspiritoSantoTest.php @@ -42,7 +42,7 @@ public function provideValidNumbersAndExpectedFormat() : array public function provideEmptyData() : array { return [ - [EspiritoSanto::LONG_NAME, 0], + [EspiritoSanto::LONG_NAME, ''], ]; } diff --git a/tests/StateRegistration/GoiasTest.php b/tests/StateRegistration/GoiasTest.php index 36e980b..f8c6433 100644 --- a/tests/StateRegistration/GoiasTest.php +++ b/tests/StateRegistration/GoiasTest.php @@ -38,7 +38,7 @@ public function provideValidNumbersAndExpectedFormat() : array public function provideEmptyData() : array { return [ - [Goias::LONG_NAME, 0], + [Goias::LONG_NAME, ''], ]; } diff --git a/tests/StateRegistration/MaranhaoTest.php b/tests/StateRegistration/MaranhaoTest.php index a5345cb..70ce9f3 100644 --- a/tests/StateRegistration/MaranhaoTest.php +++ b/tests/StateRegistration/MaranhaoTest.php @@ -37,7 +37,7 @@ public function provideValidNumbersAndExpectedFormat() : array public function provideEmptyData() : array { return [ - [Maranhao::LONG_NAME, 0], + [Maranhao::LONG_NAME, ''], ]; } diff --git a/tests/StateRegistration/MatoGrossoSulTest.php b/tests/StateRegistration/MatoGrossoSulTest.php index 02ecf16..c2cb30d 100644 --- a/tests/StateRegistration/MatoGrossoSulTest.php +++ b/tests/StateRegistration/MatoGrossoSulTest.php @@ -49,7 +49,6 @@ public function provideValidNumbersAndExpectedFormat() : array public function provideEmptyData() : array { return [ - [MatoGrossoSul::LONG_NAME, 0], [MatoGrossoSul::LONG_NAME, ''], [MatoGrossoSul::LONG_NAME, null], ]; @@ -58,7 +57,7 @@ public function provideEmptyData() : array public function provideInvalidNumber() : array { return [ - [MatoGrossoSul::LONG_NAME, 1], + [MatoGrossoSul::LONG_NAME, '1'], [MatoGrossoSul::LONG_NAME, '9987477353930'], ]; } diff --git a/tests/StateRegistration/MatoGrossoTest.php b/tests/StateRegistration/MatoGrossoTest.php index 87b8280..a7172bb 100644 --- a/tests/StateRegistration/MatoGrossoTest.php +++ b/tests/StateRegistration/MatoGrossoTest.php @@ -58,59 +58,59 @@ public function provideValidNumbers() : array ['0013284135-5'], ['0013286376-6'], ['0013286372-3'], - ['13335740-6'], - ['13329659-8'], - ['13325238-8'], - ['13321779-5'], - ['13316631-7'], - ['13315986-8'], - ['13314253-1'], - ['13311864-9'], - ['13307025-5'], - ['13306973-7'], - ['13304830-6'], - ['13303486-0'], - ['13294120-1'], - ['13290722-4'], - ['13283924-5'], - ['13281414-5'], - ['13277927-7'], - ['13265692-2'], - ['13263194-6'], - ['13262435-4'], - ['13260274-1'], - ['13249876-6'], - ['13247098-5'], - ['13241159-8'], - ['13227586-4'], - ['130365630-0'], - ['130234200-0'], - ['130181544-3'], - ['130181541-9'], - ['130181537-0'], - ['130181535-4'], - ['130181534-6'], - ['130181533-8'], - ['130181532-0'], - ['130181531-1'], - ['130181530-3'], - ['130181529-0'], - ['130181528-1'], - ['130181527-3'], - ['130181526-5'], - ['130181525-7'], - ['130181524-9'], - ['130181523-0'], - ['130181522-2'], - ['130181521-4'], - ['130181520-6'], - ['130181519-2'], - ['130181518-4'], - ['130181517-6'], - ['130181516-8'], - ['0064573571-0'], - ['064573571-0'], - ['64573571-0'], + ['0013335740-6'], + ['0013329659-8'], + ['0013325238-8'], + ['0013321779-5'], + ['0013316631-7'], + ['0013315986-8'], + ['0013314253-1'], + ['0013311864-9'], + ['0013307025-5'], + ['0013306973-7'], + ['0013304830-6'], + ['0013303486-0'], + ['0013294120-1'], + ['0013290722-4'], + ['0013283924-5'], + ['0013281414-5'], + ['0013277927-7'], + ['0013265692-2'], + ['0013263194-6'], + ['0013262435-4'], + ['0013260274-1'], + ['0013249876-6'], + ['0013247098-5'], + ['0013241159-8'], + ['0013227586-4'], + ['00130365630-0'], + ['00130234200-0'], + ['00130181544-3'], + ['00130181541-9'], + ['00130181537-0'], + ['00130181535-4'], + ['00130181534-6'], + ['00130181533-8'], + ['00130181532-0'], + ['00130181531-1'], + ['00130181530-3'], + ['00130181529-0'], + ['00130181528-1'], + ['00130181527-3'], + ['00130181526-5'], + ['00130181525-7'], + ['00130181524-9'], + ['00130181523-0'], + ['00130181522-2'], + ['00130181521-4'], + ['00130181520-6'], + ['00130181519-2'], + ['00130181518-4'], + ['00130181517-6'], + ['00130181516-8'], + ['00064573571-0'], + ['00064573571-0'], + ['00064573571-0'], ]; } @@ -127,7 +127,6 @@ public function provideValidNumbersAndExpectedFormat() : array public function provideEmptyData() : array { return [ - [MatoGrosso::LONG_NAME, 0], [MatoGrosso::LONG_NAME, ''], [MatoGrosso::LONG_NAME, null], ]; diff --git a/tests/StateRegistration/MinasGeraisTest.php b/tests/StateRegistration/MinasGeraisTest.php index e83e3ec..93a53a5 100644 --- a/tests/StateRegistration/MinasGeraisTest.php +++ b/tests/StateRegistration/MinasGeraisTest.php @@ -40,7 +40,6 @@ public function provideValidNumbersAndExpectedFormat() : array public function provideEmptyData() : array { return [ - [MG::LONG_NAME, 0], [MG::LONG_NAME, ''], [MG::LONG_NAME, null], ]; @@ -49,7 +48,7 @@ public function provideEmptyData() : array public function provideInvalidNumber() : array { return [ - [MG::LONG_NAME, 1], + [MG::LONG_NAME, '1'], [MG::LONG_NAME, '9987477353930'], ]; } diff --git a/tests/StateRegistration/ParaTest.php b/tests/StateRegistration/ParaTest.php index 2f1cc63..d52b4cf 100644 --- a/tests/StateRegistration/ParaTest.php +++ b/tests/StateRegistration/ParaTest.php @@ -46,6 +46,7 @@ public function provideEmptyData() : array { return [ [Para::LONG_NAME, null], + [Para::LONG_NAME, ''], ]; } diff --git a/tests/StateRegistration/ParaibaTest.php b/tests/StateRegistration/ParaibaTest.php index e27265a..5fba56d 100644 --- a/tests/StateRegistration/ParaibaTest.php +++ b/tests/StateRegistration/ParaibaTest.php @@ -137,6 +137,7 @@ public function provideEmptyData() : array { return [ [Paraiba::LONG_NAME, null], + [Paraiba::LONG_NAME, ''], ]; } diff --git a/tests/StateRegistration/PernambucoTest.php b/tests/StateRegistration/PernambucoTest.php index 95b9441..150c95d 100644 --- a/tests/StateRegistration/PernambucoTest.php +++ b/tests/StateRegistration/PernambucoTest.php @@ -44,6 +44,7 @@ public function provideEmptyData() : array { return [ [Pernambuco::LONG_NAME, null], + [Pernambuco::LONG_NAME, ''], ]; } diff --git a/tests/StateRegistration/PiauiTest.php b/tests/StateRegistration/PiauiTest.php index e315ec3..958545d 100644 --- a/tests/StateRegistration/PiauiTest.php +++ b/tests/StateRegistration/PiauiTest.php @@ -39,6 +39,7 @@ public function provideEmptyData() : array { return [ [Piaui::LONG_NAME, null], + [Piaui::LONG_NAME, ''], ]; } diff --git a/tests/StateRegistration/RioDeJaneiroTest.php b/tests/StateRegistration/RioDeJaneiroTest.php index c4afad1..b4dcd8d 100644 --- a/tests/StateRegistration/RioDeJaneiroTest.php +++ b/tests/StateRegistration/RioDeJaneiroTest.php @@ -37,9 +37,8 @@ public function provideValidNumbersAndExpectedFormat() : array public function provideEmptyData() : array { return [ - [RioDeJaneiro::LONG_NAME, null], - [RioDeJaneiro::LONG_NAME, false], [RioDeJaneiro::LONG_NAME, ''], + [RioDeJaneiro::LONG_NAME, null], ]; } diff --git a/tests/StateRegistration/RioGrandeDoNorteTest.php b/tests/StateRegistration/RioGrandeDoNorteTest.php index 2eb492a..062c357 100644 --- a/tests/StateRegistration/RioGrandeDoNorteTest.php +++ b/tests/StateRegistration/RioGrandeDoNorteTest.php @@ -46,6 +46,7 @@ public function provideEmptyData() : array { return [ [RioGrandeDoNorte::LONG_NAME, ''], + [RioGrandeDoNorte::LONG_NAME, null], ]; } diff --git a/tests/StateRegistration/RioGrandeDoSulTest.php b/tests/StateRegistration/RioGrandeDoSulTest.php index d23e27c..01efe07 100644 --- a/tests/StateRegistration/RioGrandeDoSulTest.php +++ b/tests/StateRegistration/RioGrandeDoSulTest.php @@ -39,6 +39,7 @@ public function provideEmptyData() : array { return [ [RioGrandeDoSul::LONG_NAME, ''], + [RioGrandeDoSul::LONG_NAME, null], ]; } diff --git a/tests/StateRegistration/RondoniaTest.php b/tests/StateRegistration/RondoniaTest.php index 985ff99..8b0809b 100644 --- a/tests/StateRegistration/RondoniaTest.php +++ b/tests/StateRegistration/RondoniaTest.php @@ -64,6 +64,7 @@ public function provideEmptyData() : array { return [ [Rondonia::LONG_NAME, ''], + [Rondonia::LONG_NAME, null], ]; } diff --git a/tests/StateRegistration/RoraimaTest.php b/tests/StateRegistration/RoraimaTest.php index 33974cd..7b9dd8f 100644 --- a/tests/StateRegistration/RoraimaTest.php +++ b/tests/StateRegistration/RoraimaTest.php @@ -47,6 +47,7 @@ public function provideEmptyData() : array { return [ [Roraima::LONG_NAME, ''], + [Roraima::LONG_NAME, null], ]; } diff --git a/tests/StateRegistration/SantaCatarinaTest.php b/tests/StateRegistration/SantaCatarinaTest.php index c6be73f..b57e8fe 100644 --- a/tests/StateRegistration/SantaCatarinaTest.php +++ b/tests/StateRegistration/SantaCatarinaTest.php @@ -38,6 +38,7 @@ public function provideValidNumbersAndExpectedFormat() : array public function provideEmptyData() : array { return [ + [SantaCatarina::LONG_NAME, null], [SantaCatarina::LONG_NAME, ''], ]; } diff --git a/tests/StateRegistration/SaoPauloTest.php b/tests/StateRegistration/SaoPauloTest.php index 0ca9d13..5fadfcd 100644 --- a/tests/StateRegistration/SaoPauloTest.php +++ b/tests/StateRegistration/SaoPauloTest.php @@ -39,6 +39,7 @@ public function provideEmptyData() : array { return [ [SaoPaulo::LONG_NAME, ''], + [SaoPaulo::LONG_NAME, null], ]; } diff --git a/tests/StateRegistration/SergipeTest.php b/tests/StateRegistration/SergipeTest.php index 5cbd41d..b84f3bc 100644 --- a/tests/StateRegistration/SergipeTest.php +++ b/tests/StateRegistration/SergipeTest.php @@ -37,6 +37,7 @@ public function provideValidNumbersAndExpectedFormat() : array public function provideEmptyData() : array { return [ + [Sergipe::LONG_NAME, null], [Sergipe::LONG_NAME, ''], ]; } diff --git a/tests/StateRegistration/TocantinsTest.php b/tests/StateRegistration/TocantinsTest.php index da7e230..85b5733 100644 --- a/tests/StateRegistration/TocantinsTest.php +++ b/tests/StateRegistration/TocantinsTest.php @@ -42,6 +42,7 @@ public function provideEmptyData() : array { return [ [Tocantins::LONG_NAME, ''], + [Tocantins::LONG_NAME, null], ]; } diff --git a/tests/VoterTest.php b/tests/VoterTest.php index 3017dda..fa54b5f 100644 --- a/tests/VoterTest.php +++ b/tests/VoterTest.php @@ -40,15 +40,12 @@ public function provideEmptyData() : array { return [ [Voter::LABEL, ''], - [Voter::LABEL, null], - [Voter::LABEL, 0], ]; } public function provideInvalidNumber() : array { return [ - [Voter::LABEL, 1], [Voter::LABEL, '123123232323'], [Voter::LABEL, '861238979874'], ];