release: v3.2.0

This commit is contained in:
Nuno Maduro
2024-09-23 13:14:03 +01:00
parent f291cd1603
commit a55da85dd2
13 changed files with 99 additions and 9 deletions

View File

@ -223,7 +223,7 @@ final class Expectation
throw new BadMethodCallException('Expectation value is not iterable.');
}
if (count($callbacks) == 0) {
if ($callbacks === []) {
throw new InvalidArgumentException('No sequence expectations defined.');
}
@ -515,6 +515,19 @@ final class Expectation
);
}
/**
* Asserts that the given expectation target uses strict equality.
*/
public function toUseStrictEquality(): ArchExpectation
{
return Targeted::make(
$this,
fn (ObjectDescription $object): bool => ! str_contains((string) file_get_contents($object->path), ' == '), // @pest-arch-ignore-line
'to use strict equality',
FileLineFinder::where(fn (string $line): bool => str_contains($line, ' == ')),
);
}
/**
* Asserts that the given expectation target is final.
*/