Skip to content

Commit d085ac8

Browse files
committed
bump package
1 parent bd08c3e commit d085ac8

32 files changed

+201
-125
lines changed

.github/workflows/phpunit.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: phpunit
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
php: ["8.4", "8.3", "8.2", "8.1", "8.0", "7.4"]
13+
dependency-version: ["prefer-lowest", "prefer-stable"]
14+
exclude:
15+
- php: "8.4"
16+
dependency-version: "prefer-lowest"
17+
- php: "8.3"
18+
dependency-version: "prefer-lowest"
19+
- php: "8.2"
20+
dependency-version: "prefer-lowest"
21+
- php: "8.1"
22+
dependency-version: "prefer-lowest"
23+
24+
name: P${{ matrix.php }} - ${{ matrix.dependency-version }}
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: ${{ matrix.php }}
32+
extensions: dom, curl, libxml, mbstring, zip
33+
tools: composer:v2
34+
35+
- run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
36+
37+
- run: vendor/bin/phpunit

.github/workflows/pint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: pint
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
style:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: 8.4
17+
extensions: dom, curl, libxml, mbstring, zip
18+
tools: composer:v2
19+
20+
- run: composer install --prefer-dist --no-interaction
21+
22+
- run: vendor/bin/pint --test

.github/workflows/run-tests.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.styleci.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Offset Earth](https://img.shields.io/badge/Treeware-%F0%9F%8C%B3-green?style=for-the-badge)](https://forest.astrotomic.info)
66
[![Larabelles](https://img.shields.io/badge/Larabelles-%F0%9F%A6%84-lightpink?style=for-the-badge)](https://larabelles.com)
77

8-
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Astrotomic/phpunit-assertions/run-tests?style=flat-square&logoColor=white&logo=github&label=Tests)](https://github.com/Astrotomic/phpunit-assertions/actions?query=workflow%3Apest)
8+
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/Astrotomic/phpunit-assertions/phpunit.yml?style=flat-square&logoColor=white&logo=github&label=Tests)](https://github.com/Astrotomic/phpunit-assertions/actions?query=workflow%3Aphpunit)
99
[![Total Downloads](https://img.shields.io/packagist/dt/astrotomic/phpunit-assertions.svg?label=Downloads&style=flat-square)](https://packagist.org/packages/astrotomic/phpunit-assertions)
1010
[![Trees](https://img.shields.io/ecologi/trees/astrotomic?style=flat-square)](https://forest.astrotomic.info)
1111
[![Carbon](https://img.shields.io/ecologi/carbon/astrotomic?style=flat-square)](https://forest.astrotomic.info)
@@ -195,4 +195,4 @@ This will prevent any method name conflicts with core, your custom or other trai
195195
'<p>Price: <code>{{ number_format($price, 2) }} €</code></p>',
196196
['price' => 99.99]
197197
);
198-
```
198+
```

composer.json

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,29 @@
1717
"homepage": "https://github.com/Astrotomic/phpunit-assertions",
1818
"require": {
1919
"php": "^7.4 || ^8.0",
20-
"phpunit/phpunit": "^9.1 || ^10.0"
20+
"phpunit/phpunit": "^9.1 || ^10.0 || ^11.0"
2121
},
2222
"require-dev": {
2323
"astrotomic/iso639": "^1.0",
24-
"egulias/email-validator": "^2.1 || ^3.0",
24+
"egulias/email-validator": "^2.1 || ^3.0 || ^4.0",
2525
"gajus/dindent": "^2.0",
26-
"giggsey/libphonenumber-for-php": "^8.12",
27-
"hashids/hashids": "^4.0",
28-
"league/iso3166": "^2.1 || ^3.0",
29-
"orchestra/testbench": "^6.0 || ^7.0",
26+
"giggsey/libphonenumber-for-php": "^8.12 || ^9.0",
27+
"hashids/hashids": "^4.0 || ^5.0",
28+
"laravel/pint": "^1.22",
29+
"league/iso3166": "^2.1 || ^3.0 || ^4.0",
30+
"orchestra/testbench": "^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0",
3031
"ramsey/uuid": "^4.0",
31-
"vinkla/hashids": "^9.0 || ^10.0"
32+
"vinkla/hashids": "^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0"
3233
},
3334
"suggest": {
3435
"astrotomic/iso639": "\\Astrotomic\\PhpunitAssertions\\LanguageAssertions (^1.0)",
35-
"egulias/email-validator": "\\Astrotomic\\PhpunitAssertions\\EmailAssertions (^2.1 || ^3.0)",
36+
"egulias/email-validator": "\\Astrotomic\\PhpunitAssertions\\EmailAssertions (^2.1 || ^3.0 || ^4.0)",
3637
"gajus/dindent": "\\Astrotomic\\PhpunitAssertions\\Laravel\\BladeAssertions (^2.0)",
37-
"giggsey/libphonenumber-for-php": "\\Astrotomic\\PhpunitAssertions\\PhoneNumberAssertions (^8.12)",
38-
"hashids/hashids": "\\Astrotomic\\PhpunitAssertions\\HashidAssertions (^4.0)",
39-
"league/iso3166": "\\Astrotomic\\PhpunitAssertions\\CountryAssertions (^2.1 || ^3.0)",
38+
"giggsey/libphonenumber-for-php": "\\Astrotomic\\PhpunitAssertions\\PhoneNumberAssertions (^8.12 || ^9.0)",
39+
"hashids/hashids": "\\Astrotomic\\PhpunitAssertions\\HashidAssertions (^4.0 || ^5.0)",
40+
"league/iso3166": "\\Astrotomic\\PhpunitAssertions\\CountryAssertions (^2.1 || ^3.0 || ^4.0)",
4041
"ramsey/uuid": "\\Astrotomic\\PhpunitAssertions\\UuidAssertions (^4.0)",
41-
"vinkla/hashids": "\\Astrotomic\\PhpunitAssertions\\Laravel\\HashidAssertions (^9.0)"
42+
"vinkla/hashids": "\\Astrotomic\\PhpunitAssertions\\Laravel\\HashidAssertions (^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0)"
4243
},
4344
"minimum-stability": "dev",
4445
"prefer-stable": true,
@@ -61,7 +62,9 @@
6162
"@composer normalize --ansi --no-interaction --quiet",
6263
"@composer thanks --ansi --no-interaction --quiet"
6364
],
65+
"fix": "@php vendor/bin/pint",
6466
"normalize": "echo 'composer global require ergebnis/composer-normalize'",
67+
"test": "@php vendor/bin/phpunit",
6568
"thanks": "echo 'composer global require symfony/thanks'"
6669
}
6770
}

src/EmailAssertions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static function assertValidLoose($actual): void
1717
public static function assertValidStrict($actual): void
1818
{
1919
PHPUnit::assertIsString($actual);
20-
PHPUnit::assertTrue((new EmailValidator())->isValid($actual, new RFCValidation()));
20+
PHPUnit::assertTrue((new EmailValidator)->isValid($actual, new RFCValidation));
2121
}
2222

2323
public static function assertDomain(string $expected, $actual): void

src/HashidAssertions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ public static function assertHashId(
4141
int $minHashLength = 0,
4242
?string $alphabet = null
4343
): void {
44-
static::assertHashIds($actual, 1, $salt, $minHashLength, $alphabet);
44+
self::assertHashIds($actual, 1, $salt, $minHashLength, $alphabet);
4545
}
4646
}

src/LanguageAssertions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ final class LanguageAssertions
1010
public static function assertName($actual): void
1111
{
1212
PHPUnit::assertIsString($actual);
13-
$language = (new ISO639())->name($actual);
13+
$language = (new ISO639)->name($actual);
1414
PHPUnit::assertIsArray($language);
1515
}
1616

src/Laravel/BladeAssertions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ final class BladeAssertions
1111
{
1212
public static function assertRenderEquals(string $expected, string $template, array $data = []): void
1313
{
14-
$indenter = new Indenter();
14+
$indenter = new Indenter;
1515

1616
PHPUnit::assertSame(
1717
$indenter->indent($expected),
18-
$indenter->indent((string) static::render($template, $data))
18+
$indenter->indent((string) self::render($template, $data))
1919
);
2020
}
2121

src/Laravel/HashidAssertions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ public static function assertHashIds($actual, ?int $count = null, ?string $conne
2222

2323
public static function assertHashId($actual, ?string $connection = null): void
2424
{
25-
static::assertHashIds($actual, 1, $connection);
25+
self::assertHashIds($actual, 1, $connection);
2626
}
2727
}

src/Laravel/ModelAssertions.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ final class ModelAssertions
1212
{
1313
/**
1414
* @param string|\Illuminate\Database\Eloquent\Model $table
15-
* @param array $data
16-
* @param string|null $connection
1715
*/
1816
public static function assertExists($table, array $data = [], ?string $connection = null): void
1917
{
@@ -34,7 +32,6 @@ public static function assertExists($table, array $data = [], ?string $connectio
3432
}
3533

3634
/**
37-
* @param \Illuminate\Database\Eloquent\Model $expected
3835
* @param \Illuminate\Database\Eloquent\Model|mixed $actual
3936
*/
4037
public static function assertSame(Model $expected, $actual): void
@@ -45,10 +42,7 @@ public static function assertSame(Model $expected, $actual): void
4542
}
4643

4744
/**
48-
* @param \Illuminate\Database\Eloquent\Model $model
49-
* @param string $relation
5045
* @param string|\Illuminate\Database\Eloquent\Model|mixed $actual
51-
* @param string|null $type
5246
*/
5347
public static function assertRelated(Model $model, string $relation, $actual, ?string $type = null)
5448
{

src/NullableTypeAssertions.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ final class NullableTypeAssertions
1111
*/
1212
public static function assertIsNullableString($actual): void
1313
{
14-
static::assertIsNullableType(
14+
self::assertIsNullableType(
1515
is_null($actual) || is_string($actual),
1616
'string',
1717
$actual
@@ -23,7 +23,7 @@ public static function assertIsNullableString($actual): void
2323
*/
2424
public static function assertIsNullableInt($actual): void
2525
{
26-
static::assertIsNullableType(
26+
self::assertIsNullableType(
2727
is_null($actual) || is_int($actual),
2828
'int',
2929
$actual
@@ -35,7 +35,7 @@ public static function assertIsNullableInt($actual): void
3535
*/
3636
public static function assertIsNullableFloat($actual): void
3737
{
38-
static::assertIsNullableType(
38+
self::assertIsNullableType(
3939
is_null($actual) || (is_numeric($actual) && (is_int($actual) || is_float($actual))),
4040
'float',
4141
$actual
@@ -47,7 +47,7 @@ public static function assertIsNullableFloat($actual): void
4747
*/
4848
public static function assertIsNullableArray($actual): void
4949
{
50-
static::assertIsNullableType(
50+
self::assertIsNullableType(
5151
is_null($actual) || is_array($actual),
5252
'array',
5353
$actual
@@ -59,16 +59,14 @@ public static function assertIsNullableArray($actual): void
5959
*/
6060
public static function assertIsNullableBool($actual): void
6161
{
62-
static::assertIsNullableType(
62+
self::assertIsNullableType(
6363
is_null($actual) || is_bool($actual),
6464
'boolean',
6565
$actual
6666
);
6767
}
6868

6969
/**
70-
* @param bool $condition
71-
* @param string $type
7270
* @param mixed|null $actual
7371
*/
7472
protected static function assertIsNullableType(bool $condition, string $type, $actual): void

tests/ArrayAssertionsTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ final class ArrayAssertionsTest extends TestCase
88
{
99
/**
1010
* @test
11+
*
1112
* @dataProvider hundredTimes
1213
*/
1314
public static function it_can_validate_array_is_indexed(): void
@@ -19,6 +20,7 @@ public static function it_can_validate_array_is_indexed(): void
1920

2021
/**
2122
* @test
23+
*
2224
* @dataProvider hundredTimes
2325
*/
2426
public static function it_can_validate_array_is_associative(): void
@@ -30,6 +32,7 @@ public static function it_can_validate_array_is_associative(): void
3032

3133
/**
3234
* @test
35+
*
3336
* @dataProvider hundredTimes
3437
*/
3538
public static function it_can_validate_indexed_array_equality(): void
@@ -45,6 +48,7 @@ public static function it_can_validate_indexed_array_equality(): void
4548

4649
/**
4750
* @test
51+
*
4852
* @dataProvider hundredTimes
4953
*/
5054
public static function it_can_validate_associative_array_equality(): void
@@ -60,6 +64,7 @@ public static function it_can_validate_associative_array_equality(): void
6064

6165
/**
6266
* @test
67+
*
6368
* @dataProvider hundredTimes
6469
*/
6570
public static function it_can_validate_associative_array_subset(): void
@@ -75,6 +80,7 @@ public static function it_can_validate_associative_array_subset(): void
7580

7681
/**
7782
* @test
83+
*
7884
* @dataProvider hundredTimes
7985
*/
8086
public static function it_can_validate_indexed_array_contains_all(): void
@@ -90,6 +96,7 @@ public static function it_can_validate_indexed_array_contains_all(): void
9096

9197
/**
9298
* @test
99+
*
93100
* @dataProvider hundredTimes
94101
*/
95102
public static function it_can_validate_associative_array_contains_all(): void

0 commit comments

Comments
 (0)