bovigo/assert
Functional-style assertions for PHP unit tests. Use assertThat(value, predicate[, description]) for readable checks with helpful failure messages. Integrates with PHPUnit via AssertionFailure extending AssertionFailedError. Requires PHP 8.3+.
bovigo\assert\CatchedError, introduced bovigo\assert\TriggeredError insteadbovigo\assert\CatchedException, introduced bovigo\assert\CaughtThrowable insteadbovigo\assert\predicate\isNotEqualTo() to properly reflect that the returned instance is both of type bovigo\assert\predicate\Predicate and bovigo\assert\predicate\Deltabovigo\assert\fail() to never, accordingly removed src/main/resources/phpstan/bovigo-assert.neon as it is not required any morebovigo\assert\predicate\equals()$delta from bovigo\assert\predicate\equals() and bovigo\assert\predicate\isNotEqualTo(), use new method withDelta() on returned instancecontainsSubset (@lyrixx)$delta in bovigo\assert\predicate\equals() and bovigo\assert\predicate\isNotEqualTo(), use new method withDelta() on returned instancesrc/main/resources/phpstan/bovigo-assert.neonbovigo\assert\CatchedError::message() and bovigo\assert\CatchedException::message() to really accept a callablebovigo\assert\assert()bovigo\assert\predicate\isOfType() can now check for iterable typesassertInternalType() and assertNotInternalType() introduced with PHPUnit 7.5bovigo\assert\predicate\isOfType() and bovigo\assert\predicate\isNotOfType() uses:
bovigo\assert\predicate\isArray()bovigo\assert\predicate\isNotAnArray()bovigo\assert\predicate\isBool()bovigo\assert\predicate\isNotBool()bovigo\assert\predicate\isFloat()bovigo\assert\predicate\isNotFloat()bovigo\assert\predicate\isInt()bovigo\assert\predicate\isNotInt()bovigo\assert\predicate\isNumeric()bovigo\assert\predicate\isNotNumeric()bovigo\assert\predicate\isObject()bovigo\assert\predicate\isNotAnObject()bovigo\assert\predicate\isResource()bovigo\assert\predicate\isNotAResource()bovigo\assert\predicate\isString()bovigo\assert\predicate\isNotAString()bovigo\assert\predicate\isScalar()bovigo\assert\predicate\isNotScalar()bovigo\assert\predicate\isCallable()bovigo\assert\predicate\isNotCallable()bovigo\assert\predicate\isIterable()bovigo\assert\predicate\isNotIterable()bovigo\assert\predicate\matchesFormat() and bovigo\assert\predicate\doesNotMatchFormat()bovigo\assert\assert() not executed when zend.assertions not set to 1
bovigo\assert\assertThat(), made bovigo\assert\assert() an alias for thisbovigo\assert\assert()BC breaks
raised minimum required PHP version to 7.1.0 updated dependencies to be compatible with PHPUnit 6.x
bovigo\assert\outputOf()bovigo\assert\expect() should work with \Errorbovigo\assert\expect() should provide possibility to test trigger_error()bovigo\assert\expect()->throws() with an instance of \Throwable, will assert thrown exception is identical instead of asserting correct type onlybovigo\assert\predicate\Predicate::asWellAs(), use bovigo\assert\predicate\Predicate::and() instead, deprecated since 1.4.0bovigo\assert\predicate\Predicate::orElse(), use bovigo\assert\predicate\Predicate::or() instead, deprecated since 1.4.0bovigo\assert\predicate\Predicate::negate(), use bovigo\assert\predicate\not() instead, deprecated since 1.4.0bovigo\assert\predicate\Equals::hasDiffForLastFailure()bovigo\assert\predicate\Equals::diffForLastFailure()bovigo\assert\expect()bovigo\assert\assertEmptyString()bovigo\assert\assertEmptyArray()bovigo\assert\predicate\Predicate::asWellAs() in favor of bovigo\assert\predicate\Predicate::and(), will be removed with 2.0.0bovigo\assert\predicate\Predicate::orElse() in favor of bovigo\assert\predicate\Predicate::or(), will be removed with 2.0.0bovigo\assert\predicate\Predicate::negate() in favor of bovigo\assert\predicate\not(), will be removed with 2.0.0bovigo\assert\predicate\Predicate::and()bovigo\assert\predicate\Predicate::or()bovigo\assert\predicate\eachKey()bovigo\assert\assertTrue()bovigo\assert\assertFalse()bovigo\assert\assertNull()bovigo\assert\assertNotNull()bovigo\assert\assertEmpty()bovigo\assert\assertNotEmpty()bovigo\assert\predicate\each() and bovigo\assert\predicate\isOfSize() can now work with non-cloneable traversablesbovigo\assert\fail()bovigo\assert\predicate\each()bovigo\assert\phpunit\PHPUnit_Framework_TestCase::assertContainsOnly()bovigo\assert\phpunit\PHPUnit_Framework_TestCase::assertContainsOnlyInstancesOf()bovigo\assert\phpunit\PHPUnit_Framework_TestCase::assertNotContainsOnly()bovigo\assert\predicate\startsWith()bovigo\assert\phpunit\PHPUnit_Framework_TestCase::assertStringStartsWith()bovigo\assert\predicate\doesNotStartWith()bovigo\assert\phpunit\PHPUnit_Framework_TestCase::assertStringStartsNotWith()bovigo\assert\predicate\endsWith()bovigo\assert\phpunit\PHPUnit_Framework_TestCase::assertStringEndsWith()bovigo\assert\predicate\doesNotEndWith()bovigo\assert\phpunit\PHPUnit_Framework_TestCase::assertStringEndsNotWith()bovigo\assert\phpunit\PHPUnit_Framework_TestCase::assertNan()bovigo\assert\phpunit\PHPUnit_Framework_TestCase::assertFinite()bovigo\assert\phpunit\PHPUnit_Framework_TestCase::assertInfinite()bovigo\assert\predicate\not() now also accepts callablesHow can I help you explore Laravel packages today?