Releases: spiral/testing
Releases · spiral/testing
v2.5.0
What's Changed
Full Changelog: 2.4.1...2.5.0
v2.4.1
What's Changed
- Fixes problem with rebinding singletons. by @butschster in #60
Full Changelog: 2.4.0...2.4.1
v2.4.0
What's Changed
- PHP Attributes for Environment and Configuration Variables, and Exception Handling by @butschster in #55
- InteractsWithMailer, InteractsWithQueue. Ability to use several times by @gam6itko in #56
- FakeQueue fix job name as string by @gam6itko in #58
- FakeQueue asserts returns jobs list by @gam6itko in #59
Full Changelog: 2.3.1...2.4.0
v2.3.1
What's Changed
Full Changelog: 2.3.0...2.3.1
v2.3.0
What's Changed
- FakeHttp add methods
patch
andpatchJson
by @gam6itko in #35 TestCase::getApp
returnsTestableKernelInterface
by @gam6itko in #37TestCase
removefinal
from public methods by @gam6itko in #40- fakeHttp proper
json
request header names by @gam6itko in #39 TestCase::getApp
- init app on first run. by @gam6itko in #36- Fixed acceptable types for queue payload by @butschster in #48
- Added current scope container by @butschster in #49
- Added support for roadrunner-bridge 2.x, 3.x by @butschster in #50
- Fixed problem with returning value using
FakeEventDispatcher::dispatch
method, when application doesn't have EventDispatcher implementation by @butschster in #51 - Added assertions for scaffolder commands by @butschster in #53
New Contributors
Full Changelog: 2.2.0...2.3.0
v2.2.0
What's Changed
- Add assertConfigHasFragments by @kastahov in #30
config/http.php
return [
'basePath' => '/',
'headers' => [
'Content-Type' => 'text/html; charset=UTF-8',
],
'middleware' => [],
];
$this->assertConfigHasFragments('http', [
'basePath' => '/'
]);
$this->assertConfigHasFragments('http', [
'headers' => [
'Content-Type' => 'text/html; charset=UTF-8',
],
]);
New Contributors
- @kastahov made their first contribution in #30
Full Changelog: 2.1.0...2.2.0
v2.1.0
What's Changed
- Added ability to fake event dispatcher by @butschster in #29
Interaction with Events
protected function setUp(): void
{
parent::setUp();
$this->eventDispatcher = $this->fakeEventDispatcher();
}
assertListening
Assert if an event has a listener attached to it.
$this->eventDispatcher->assertListening(SomeEvent::class, SomeListener::class);
assertDispatched
Assert if an event was dispatched based on a truth-test callback.
// Assert if an event dispatched one or more times
$this->eventDispatcher->assertDispatched(SomeEvent::class);
// Assert if an event dispatched one or more times based on a truth-test callback.
$this->eventDispatcher->assertDispatched(SomeEvent::class, static function(SomeEvent $event): bool {
return $event->someParam === 100;
});
assertDispatchedTimes
Assert if an event was dispatched a number of times.
$this->eventDispatcher->assertDispatchedTimes(SomeEvent::class, 5);
assertNotDispatched
Determine if an event was dispatched based on a truth-test callback.
$this->eventDispatcher->assertNotDispatched(SomeEvent::class);
$this->eventDispatcher->assertNotDispatched(SomeEvent::class, static function(SomeEvent $event): bool {
return $event->someParam === 100;
});
assertNothingDispatched
Assert that no events were dispatched.
$this->eventDispatcher->assertNothingDispatched();
dispatched
Get all the events matching a truth-test callback.
$this->eventDispatcher->dispatched(SomeEvent::class);
// or
$this->eventDispatcher->dispatched(SomeEvent::class, static function(SomeEvent $event): bool {
return $event->someParam === 100;
});
hasDispatched
$this->eventDispatcher->hasDispatched(SomeEvent::class);
Full Changelog: 2.0.0...2.1.0
v2.0.0
What's Changed
- Adds support for spiral/framework 3.0 by @butschster in #19
- Changing the method of adding bootloaders by @msmakouz in #20
- Adds an ability to send Stream via fake HTTP requests by @butschster in #21
- Adding Nyholm bridge, removing DiactorosBootloader by @msmakouz in #22
- Adds assertion for checking if console command registered by @butschster in #26
Full Changelog: 1.2.1...2.0.0
v1.3.0
What's Changed
- Adds an ability to send Stream via fake HTTP requests by @butschster in #21
Full Changelog: 1.2.1...1.3.0
v2.0-beta
What's Changed
- Adds support for spiral/framework 3.0 by @butschster in #19
- Changing the method of adding bootloaders by @msmakouz in #20
- Adds an ability to send Stream via fake HTTP requests by @butschster in #21
Full Changelog: 1.2.1...2.0.0