mirror of
https://github.com/werkraum-media/events.git
synced 2024-11-22 03:16:11 +01:00
Expose settings via DateSearchVariables
Event (#58)
This commit is contained in:
parent
15d233c834
commit
2168412ae5
4 changed files with 75 additions and 0 deletions
|
@ -83,6 +83,7 @@ final class DateController extends AbstractController
|
||||||
}
|
}
|
||||||
|
|
||||||
$event = $this->eventDispatcher->dispatch(new DateSearchVariables(
|
$event = $this->eventDispatcher->dispatch(new DateSearchVariables(
|
||||||
|
$this->settings,
|
||||||
$search,
|
$search,
|
||||||
$demand,
|
$demand,
|
||||||
$this->regionRepository->findAll(),
|
$this->regionRepository->findAll(),
|
||||||
|
|
|
@ -19,6 +19,7 @@ final class DateSearchVariables
|
||||||
* @param array<Category> $features
|
* @param array<Category> $features
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
private readonly array $settings,
|
||||||
private readonly array $search,
|
private readonly array $search,
|
||||||
private readonly DateDemand $demand,
|
private readonly DateDemand $demand,
|
||||||
private readonly QueryResultInterface $regions,
|
private readonly QueryResultInterface $regions,
|
||||||
|
@ -27,6 +28,11 @@ final class DateSearchVariables
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSettings(): array
|
||||||
|
{
|
||||||
|
return $this->settings;
|
||||||
|
}
|
||||||
|
|
||||||
public function getSearch(): array
|
public function getSearch(): array
|
||||||
{
|
{
|
||||||
return $this->search;
|
return $this->search;
|
||||||
|
|
27
Documentation/Changelog/3.8.0.rst
Normal file
27
Documentation/Changelog/3.8.0.rst
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
3.8.0
|
||||||
|
=====
|
||||||
|
|
||||||
|
Breaking
|
||||||
|
--------
|
||||||
|
|
||||||
|
Nothing
|
||||||
|
|
||||||
|
Features
|
||||||
|
--------
|
||||||
|
|
||||||
|
* Expose settings via `DateSearchVariables` Event.
|
||||||
|
|
||||||
|
Fixes
|
||||||
|
-----
|
||||||
|
|
||||||
|
Nothing
|
||||||
|
|
||||||
|
Tasks
|
||||||
|
-----
|
||||||
|
|
||||||
|
Nothing
|
||||||
|
|
||||||
|
Deprecation
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Nothing
|
|
@ -16,6 +16,8 @@ class DateSearchVariablesTest extends TestCase
|
||||||
public function canBeCreated(): void
|
public function canBeCreated(): void
|
||||||
{
|
{
|
||||||
$subject = new DateSearchVariables(
|
$subject = new DateSearchVariables(
|
||||||
|
[
|
||||||
|
],
|
||||||
[
|
[
|
||||||
],
|
],
|
||||||
new DateDemand(),
|
new DateDemand(),
|
||||||
|
@ -30,10 +32,35 @@ class DateSearchVariablesTest extends TestCase
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[Test]
|
||||||
|
public function returnsInitializeSettings(): void
|
||||||
|
{
|
||||||
|
$subject = new DateSearchVariables(
|
||||||
|
[
|
||||||
|
'someCustomKey' => 'someCustomValue',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
],
|
||||||
|
new DateDemand(),
|
||||||
|
$this->createStub(QueryResult::class),
|
||||||
|
[],
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
|
||||||
|
self::assertSame(
|
||||||
|
[
|
||||||
|
'someCustomKey' => 'someCustomValue',
|
||||||
|
],
|
||||||
|
$subject->getSettings()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[Test]
|
#[Test]
|
||||||
public function returnsInitializeSearch(): void
|
public function returnsInitializeSearch(): void
|
||||||
{
|
{
|
||||||
$subject = new DateSearchVariables(
|
$subject = new DateSearchVariables(
|
||||||
|
[
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'executed' => '1',
|
'executed' => '1',
|
||||||
],
|
],
|
||||||
|
@ -56,6 +83,8 @@ class DateSearchVariablesTest extends TestCase
|
||||||
{
|
{
|
||||||
$demand = new DateDemand();
|
$demand = new DateDemand();
|
||||||
$subject = new DateSearchVariables(
|
$subject = new DateSearchVariables(
|
||||||
|
[
|
||||||
|
],
|
||||||
[
|
[
|
||||||
],
|
],
|
||||||
$demand,
|
$demand,
|
||||||
|
@ -75,6 +104,8 @@ class DateSearchVariablesTest extends TestCase
|
||||||
{
|
{
|
||||||
$regions = $this->createStub(QueryResult::class);
|
$regions = $this->createStub(QueryResult::class);
|
||||||
$subject = new DateSearchVariables(
|
$subject = new DateSearchVariables(
|
||||||
|
[
|
||||||
|
],
|
||||||
[
|
[
|
||||||
],
|
],
|
||||||
new DateDemand(),
|
new DateDemand(),
|
||||||
|
@ -93,6 +124,8 @@ class DateSearchVariablesTest extends TestCase
|
||||||
public function returnsInitialCategories(): void
|
public function returnsInitialCategories(): void
|
||||||
{
|
{
|
||||||
$subject = new DateSearchVariables(
|
$subject = new DateSearchVariables(
|
||||||
|
[
|
||||||
|
],
|
||||||
[
|
[
|
||||||
],
|
],
|
||||||
new DateDemand(),
|
new DateDemand(),
|
||||||
|
@ -115,6 +148,8 @@ class DateSearchVariablesTest extends TestCase
|
||||||
public function returnsInitialFeatures(): void
|
public function returnsInitialFeatures(): void
|
||||||
{
|
{
|
||||||
$subject = new DateSearchVariables(
|
$subject = new DateSearchVariables(
|
||||||
|
[
|
||||||
|
],
|
||||||
[
|
[
|
||||||
],
|
],
|
||||||
new DateDemand(),
|
new DateDemand(),
|
||||||
|
@ -140,6 +175,8 @@ class DateSearchVariablesTest extends TestCase
|
||||||
$demand = new DateDemand();
|
$demand = new DateDemand();
|
||||||
$regions = $this->createStub(QueryResult::class);
|
$regions = $this->createStub(QueryResult::class);
|
||||||
$subject = new DateSearchVariables(
|
$subject = new DateSearchVariables(
|
||||||
|
[
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'executed' => '1',
|
'executed' => '1',
|
||||||
],
|
],
|
||||||
|
@ -177,6 +214,8 @@ class DateSearchVariablesTest extends TestCase
|
||||||
$demand = new DateDemand();
|
$demand = new DateDemand();
|
||||||
$regions = $this->createStub(QueryResult::class);
|
$regions = $this->createStub(QueryResult::class);
|
||||||
$subject = new DateSearchVariables(
|
$subject = new DateSearchVariables(
|
||||||
|
[
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'executed' => '1',
|
'executed' => '1',
|
||||||
],
|
],
|
||||||
|
@ -219,6 +258,8 @@ class DateSearchVariablesTest extends TestCase
|
||||||
$demand = new DateDemand();
|
$demand = new DateDemand();
|
||||||
$regions = $this->createStub(QueryResult::class);
|
$regions = $this->createStub(QueryResult::class);
|
||||||
$subject = new DateSearchVariables(
|
$subject = new DateSearchVariables(
|
||||||
|
[
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'executed' => '1',
|
'executed' => '1',
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in a new issue