File tree Expand file tree Collapse file tree 12 files changed +77
-60
lines changed Expand file tree Collapse file tree 12 files changed +77
-60
lines changed Original file line number Diff line number Diff line change 3030 "phpstan/phpstan-strict-rules" : " ^2.0" ,
3131 "phpunit/phpunit" : " ^10.5 || ^11.5" ,
3232 "slevomat/coding-standard" : " ^8.16" ,
33- "symfony/var-exporter" : " ^6.4 || ^7.0"
33+ "symfony/var-exporter" : " ^6.4 || ^7.0" ,
34+ "webmozart/assert" : " ^1.12"
3435 },
3536 "autoload" : {
3637 "psr-4" : {
3940 },
4041 "autoload-dev" : {
4142 "psr-4" : {
42- "Axlon\\ PostalCodeValidation\\ Tests\\ " : " tests/"
43+ "Axlon\\ PostalCodeValidation\\ " : " build/" ,
44+ "Tests\\ " : " tests/"
4345 }
4446 },
4547 "config" : {
Original file line number Diff line number Diff line change 9898 </rule >
9999 <rule ref =" SlevomatCodingStandard.ControlStructures.UselessTernaryOperator" />
100100 <rule ref =" SlevomatCodingStandard.Exceptions.RequireNonCapturingCatch" />
101+ <rule ref =" SlevomatCodingStandard.Files.TypeNameMatchesFileName" >
102+ <properties >
103+ <property name =" rootNamespaces" type =" array" >
104+ <element key =" src" value =" Axlon\PostalCodeValidation" />
105+ <element key =" tests" value =" Tests" />
106+ </property >
107+ </properties >
108+ </rule >
101109 <rule ref =" SlevomatCodingStandard.Functions.ArrowFunctionDeclaration" >
102110 <properties >
103111 <property name =" spacesCountAfterKeyword" value =" 1" />
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
22<phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3- backupGlobals =" false"
4- bootstrap =" ./vendor/autoload.php"
5- colors =" true"
6- processIsolation =" false"
7- stopOnFailure =" false"
8- xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory =" .phpunit.cache"
9- backupStaticProperties =" false" >
10- <coverage />
3+ xsi : noNamespaceSchemaLocation =" vendor/phpunit/phpunit/phpunit.xsd"
4+ bootstrap =" vendor/autoload.php"
5+ cacheDirectory =" .phpunit.cache"
6+ executionOrder =" depends,defects"
7+ requireCoverageMetadata =" true"
8+ beStrictAboutCoverageMetadata =" true"
9+ beStrictAboutOutputDuringTests =" true"
10+ failOnRisky =" true"
11+ failOnWarning =" true" >
1112 <testsuites >
12- <testsuite name =" Integration" >
13- <directory suffix =" Test.php" >./tests/Integration</directory >
14- </testsuite >
15- <testsuite name =" Unit" >
16- <directory suffix =" Test.php" >./tests/Unit</directory >
13+ <testsuite name =" Tests" >
14+ <directory >tests</directory >
1715 </testsuite >
1816 </testsuites >
19- <source >
17+
18+ <source restrictNotices =" true" restrictWarnings =" true" >
2019 <include >
21- <directory suffix = " .php " >./ src</directory >
20+ <directory > src</directory >
2221 </include >
2322 </source >
2423</phpunit >
Original file line number Diff line number Diff line change 22
33declare (strict_types=1 );
44
5- namespace Axlon \ PostalCodeValidation \ Tests \Integration ;
5+ namespace Tests \Integration ;
66
77use Illuminate \Support \Facades \Validator ;
88use InvalidArgumentException ;
9+ use PHPUnit \Framework \Attributes \CoversNothing ;
910
11+ #[CoversNothing]
1012final class PostalCodeForTest extends TestCase
1113{
1214 /**
Original file line number Diff line number Diff line change 22
33declare (strict_types=1 );
44
5- namespace Axlon \ PostalCodeValidation \ Tests \Integration ;
5+ namespace Tests \Integration ;
66
77use Illuminate \Support \Facades \Validator ;
88use InvalidArgumentException ;
9+ use PHPUnit \Framework \Attributes \CoversNothing ;
910
11+ #[CoversNothing]
1012final class PostalCodeTest extends TestCase
1113{
1214 /**
Original file line number Diff line number Diff line change 22
33declare (strict_types=1 );
44
5- namespace Axlon \ PostalCodeValidation \ Tests \Integration ;
5+ namespace Tests \Integration ;
66
77use Illuminate \Support \Facades \Validator ;
88use InvalidArgumentException ;
9+ use PHPUnit \Framework \Attributes \CoversNothing ;
910
11+ #[CoversNothing]
1012final class PostalCodeWithTest extends TestCase
1113{
1214 /**
Original file line number Diff line number Diff line change 22
33declare (strict_types=1 );
44
5- namespace Axlon \ PostalCodeValidation \ Tests \Integration ;
5+ namespace Tests \Integration ;
66
77use Illuminate \Support \Facades \Lang ;
88use Illuminate \Support \Facades \Validator ;
9+ use PHPUnit \Framework \Attributes \CoversNothing ;
910
11+ #[CoversNothing]
1012final class ReplacerTest extends TestCase
1113{
1214 /**
Original file line number Diff line number Diff line change 22
33declare (strict_types=1 );
44
5- namespace Axlon \ PostalCodeValidation \ Tests \Integration ;
5+ namespace Tests \Integration ;
66
77use Axlon \PostalCodeValidation \ValidationServiceProvider ;
88use Orchestra \Testbench \TestCase as BaseTestCase ;
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Tests ;
6+
7+ use Generator ;
8+ use Webmozart \Assert \Assert ;
9+
10+ final class PostalCodeDataProvider
11+ {
12+ public static function examplesByCountry (): Generator
13+ {
14+ $ data = require __DIR__ . '/../resources/examples.php ' ;
15+ Assert::isArray ($ data );
16+
17+ foreach ($ data as $ countryCode => $ example ) {
18+ yield $ countryCode => [$ countryCode , $ example ];
19+ }
20+
21+ /** @link https://github.com/axlon/laravel-postal-code-validation/issues/35 */
22+ yield 'IC ' => ['IC ' , '38580 ' ];
23+ }
24+ }
Original file line number Diff line number Diff line change 22
33declare (strict_types=1 );
44
5- namespace Axlon \ PostalCodeValidation \ Tests \Unit ;
5+ namespace Tests \Unit ;
66
77use Axlon \PostalCodeValidation \Support \PostalCodeExamples ;
8+ use PHPUnit \Framework \Attributes \CoversClass ;
89use PHPUnit \Framework \TestCase ;
910
11+ #[CoversClass(PostalCodeExamples::class)]
1012final class PostalCodeExamplesTest extends TestCase
1113{
1214 /**
You can’t perform that action at this time.
0 commit comments