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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [Unreleased]

### Changed

- Requires `innmind/black-box:~7.0`

## 5.2.1 - 2026-04-09

### Fixed
Expand Down
3 changes: 1 addition & 2 deletions blackbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
__DIR__.'/src/',
__DIR__.'/tests/',
)
->dumpTo('coverage.clover')
->enableWhen(true),
->dumpTo('coverage.clover'),
),
)
->tryToProve(Load::directory(__DIR__.'/tests/'))
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@
},
"require-dev": {
"innmind/static-analysis": "~1.3",
"innmind/black-box": "~6.6",
"innmind/black-box": "~7.0",
"innmind/coding-standard": "~2.0"
},
"conflict": {
"innmind/black-box": "<6.0|~7.0"
"innmind/black-box": "<7.0|~8.0"
},
"suggest": {
"innmind/black-box": "For property based testing"
},
"provide": {
"innmind/black-box-sets": "6.0"
"innmind/black-box-sets": "7.0"
}
}
4 changes: 2 additions & 2 deletions fixtures/Authority.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
final class Authority
{
/**
* @return Set\Provider<Model>
* @return Set<Model>
*/
public static function any(): Set\Provider
public static function any(): Set
{
return Set::compose(
Model::of(...),
Expand Down
4 changes: 2 additions & 2 deletions fixtures/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
final class Url
{
/**
* @return Set\Provider<Model>
* @return Set<Model>
*/
public static function any(): Set\Provider
public static function any(): Set
{
return Set::compose(
Model::from(...),
Expand Down
10 changes: 6 additions & 4 deletions tests/Authority/HostTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ public function testInterface()

public function testThrowWhenInvalidHost()
{
$this->expectException(\DomainException::class);
$this->expectExceptionMessage('foo bar');

$_ = Host::of('foo bar');
$this
->assert()
->throws(
static fn() => Host::of('foo bar'),
\DomainException::class,
);
}

public function testNull()
Expand Down
10 changes: 6 additions & 4 deletions tests/Authority/PortTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ public function testInterface()

public function testThrowWhenNegativePort()
{
$this->expectException(\DomainException::class);
$this->expectExceptionMessage('-1');

$_ = Port::of(-1);
$this
->assert()
->throws(
static fn() => Port::of(-1),
\DomainException::class,
);
}

public function testNull()
Expand Down
9 changes: 6 additions & 3 deletions tests/Authority/UserInformationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ public function testInterface()

public function testThrowWhenNullUserButPasswordPresent()
{
$this->expectException(\DomainException::class);

$_ = UserInformation::of(User::none(), Password::of('foo'));
$this
->assert()
->throws(
static fn() => UserInformation::of(User::none(), Password::of('foo')),
\DomainException::class,
);
}

public function testString()
Expand Down
6 changes: 4 additions & 2 deletions tests/AuthorityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
Authority\Port,
};
use Fixtures\Innmind\Url\Authority as Fixture;
use Innmind\BlackBox\PHPUnit\Framework\TestCase;
use Innmind\BlackBox\PHPUnit\BlackBox;
use Innmind\BlackBox\PHPUnit\{
Framework\TestCase,
BlackBox,
};

class AuthorityTest extends TestCase
{
Expand Down
3 changes: 1 addition & 2 deletions tests/Fixtures/Authority/UserInformation/PasswordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ class PasswordTest extends TestCase
*/
public function testInterface()
{
$set = Password::any();
$set = Password::any()->take(100);

$this->assertInstanceOf(Set::class, $set);

foreach ($set->values(Random::default) as $value) {
$this->assertInstanceOf(Set\Value::class, $value);
$this->assertTrue($value->immutable());
$this->assertInstanceOf(Model::class, $value->unwrap());
}
}
Expand Down
3 changes: 1 addition & 2 deletions tests/Fixtures/Authority/UserInformation/UserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ class UserTest extends TestCase
*/
public function testInterface()
{
$set = User::any();
$set = User::any()->take(100);

$this->assertInstanceOf(Set::class, $set);

foreach ($set->values(Random::default) as $value) {
$this->assertInstanceOf(Set\Value::class, $value);
$this->assertTrue($value->immutable());
$this->assertInstanceOf(Model::class, $value->unwrap());
}
}
Expand Down
3 changes: 1 addition & 2 deletions tests/Fixtures/Authority/UserInformationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ class UserInformationTest extends TestCase
*/
public function testInterface()
{
$set = UserInformation::any();
$set = UserInformation::any()->take(100);

$this->assertInstanceOf(Set::class, $set);

foreach ($set->values(Random::default) as $value) {
$this->assertInstanceOf(Set\Value::class, $value);
$this->assertTrue($value->immutable());
$this->assertInstanceOf(Model::class, $value->unwrap());
}
}
Expand Down
5 changes: 2 additions & 3 deletions tests/Fixtures/AuthorityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ class AuthorityTest extends TestCase
*/
public function testInterface()
{
$set = Authority::any();
$set = Authority::any()->take(100);

$this->assertInstanceOf(Set\Provider::class, $set);
$this->assertInstanceOf(Set::class, $set);

foreach ($set->toSet()->values(Random::default) as $value) {
$this->assertInstanceOf(Set\Value::class, $value);
$this->assertTrue($value->immutable());
$this->assertInstanceOf(Model::class, $value->unwrap());
}
}
Expand Down
3 changes: 1 addition & 2 deletions tests/Fixtures/FragmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ class FragmentTest extends TestCase
*/
public function testInterface()
{
$set = Fragment::any();
$set = Fragment::any()->take(100);

$this->assertInstanceOf(Set::class, $set);

foreach ($set->values(Random::default) as $value) {
$this->assertInstanceOf(Set\Value::class, $value);
$this->assertTrue($value->immutable());
$this->assertInstanceOf(Model::class, $value->unwrap());
}
}
Expand Down
6 changes: 2 additions & 4 deletions tests/Fixtures/PathTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ class PathTest extends TestCase
*/
public function testInterface()
{
$set = Path::any();
$set = Path::any()->take(100);

$this->assertInstanceOf(Set::class, $set);

foreach ($set->values(Random::default) as $value) {
$this->assertInstanceOf(Set\Value::class, $value);
$this->assertTrue($value->immutable());
$this->assertInstanceOf(Model::class, $value->unwrap());
}
}
Expand All @@ -34,13 +33,12 @@ public function testInterface()
*/
public function testDirectories()
{
$set = Path::directories();
$set = Path::directories()->take(100);

$this->assertInstanceOf(Set::class, $set);

foreach ($set->values(Random::default) as $value) {
$this->assertInstanceOf(Set\Value::class, $value);
$this->assertTrue($value->immutable());
$this->assertInstanceOf(Model::class, $value->unwrap());
$this->assertTrue($value->unwrap()->directory());
}
Expand Down
3 changes: 1 addition & 2 deletions tests/Fixtures/QueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ class QueryTest extends TestCase
*/
public function testInterface()
{
$set = Query::any();
$set = Query::any()->take(100);

$this->assertInstanceOf(Set::class, $set);

foreach ($set->values(Random::default) as $value) {
$this->assertInstanceOf(Set\Value::class, $value);
$this->assertTrue($value->immutable());
$this->assertInstanceOf(Model::class, $value->unwrap());
}
}
Expand Down
3 changes: 1 addition & 2 deletions tests/Fixtures/SchemeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ class SchemeTest extends TestCase
*/
public function testInterface()
{
$set = Scheme::any();
$set = Scheme::any()->take(100);

$this->assertInstanceOf(Set::class, $set);

foreach ($set->values(Random::default) as $value) {
$this->assertInstanceOf(Set\Value::class, $value);
$this->assertTrue($value->immutable());
$this->assertInstanceOf(Model::class, $value->unwrap());
}
}
Expand Down
5 changes: 2 additions & 3 deletions tests/Fixtures/UrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ class UrlTest extends TestCase
*/
public function testInterface()
{
$set = Url::any();
$set = Url::any()->take(100);

$this->assertInstanceOf(Set\Provider::class, $set);
$this->assertInstanceOf(Set::class, $set);

foreach ($set->toSet()->values(Random::default) as $value) {
$this->assertInstanceOf(Set\Value::class, $value);
$this->assertTrue($value->immutable());
$this->assertInstanceOf(Model::class, $value->unwrap());
}
}
Expand Down
12 changes: 7 additions & 5 deletions tests/PathTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
use Innmind\BlackBox\{
PHPUnit\BlackBox,
PHPUnit\Framework\TestCase,
PHPUnit\Framework\Attributes\DataProvider,
};
use PHPUnit\Framework\Attributes\DataProvider;

class PathTest extends TestCase
{
Expand All @@ -32,10 +32,12 @@ public function testInterface()

public function testThrowWhenInvalidPath()
{
$this->expectException(\DomainException::class);
$this->expectExceptionMessage('');

$_ = Path::of('');
$this
->assert()
->throws(
static fn() => Path::of(''),
\DomainException::class,
);
}

public function testNull()
Expand Down
10 changes: 6 additions & 4 deletions tests/SchemeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ public function testInterface()

public function testThrowWhenInvalidData()
{
$this->expectException(\DomainException::class);
$this->expectExceptionMessage('http://');

$_ = Scheme::of('http://');
$this
->assert()
->throws(
static fn() => Scheme::of('http://'),
\DomainException::class,
);
}

public function testNull()
Expand Down
11 changes: 7 additions & 4 deletions tests/UrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
use Fixtures\Innmind\Url\Url as Fixture;
use Innmind\BlackBox\{
PHPUnit\Framework\TestCase,
PHPUnit\Framework\Attributes\DataProvider,
PHPUnit\BlackBox,
};
use PHPUnit\Framework\Attributes\DataProvider;

class UrlTest extends TestCase
{
Expand Down Expand Up @@ -108,9 +108,12 @@ public function testMaybeReturnNothingForUnparseableStrings()

public function testThrowWhenBuildingFromInvalidString()
{
$this->expectException(\DomainException::class);

$_ = Url::of('http://user:password/path');
$this
->assert()
->throws(
static fn() => Url::of('http://user:password/path'),
\DomainException::class,
);
}

#[DataProvider('cases')]
Expand Down
Loading