diff --git a/Classes/Controller/DateController.php b/Classes/Controller/DateController.php index eecb7e4..e071636 100644 --- a/Classes/Controller/DateController.php +++ b/Classes/Controller/DateController.php @@ -133,6 +133,7 @@ class DateController extends AbstractController } $event = $this->eventDispatcher->dispatch(new DateSearchVariables( + $this->settings, $search, $demand, $this->regionRepository->findAll(), diff --git a/Classes/Events/Controller/DateSearchVariables.php b/Classes/Events/Controller/DateSearchVariables.php index cbd68c4..7058e67 100644 --- a/Classes/Events/Controller/DateSearchVariables.php +++ b/Classes/Events/Controller/DateSearchVariables.php @@ -9,6 +9,11 @@ use Wrm\Events\Domain\Model\Region; class DateSearchVariables { + /** + * @var array + */ + private $settings; + /** * @var array */ @@ -43,12 +48,14 @@ class DateSearchVariables * @param QueryResultInterface $regions */ public function __construct( + array $settings, array $search, DateDemand $demand, QueryResultInterface $regions, array $categories, array $features ) { + $this->settings = $settings; $this->search = $search; $this->demand = $demand; $this->regions = $regions; @@ -56,6 +63,11 @@ class DateSearchVariables $this->features = $features; } + public function getSettings(): array + { + return $this->settings; + } + public function getSearch(): array { return $this->search; diff --git a/Documentation/Changelog/3.8.0.rst b/Documentation/Changelog/3.8.0.rst new file mode 100644 index 0000000..5ef18ea --- /dev/null +++ b/Documentation/Changelog/3.8.0.rst @@ -0,0 +1,27 @@ +3.8.0 +===== + +Breaking +-------- + +Nothing + +Features +-------- + +* Expose settings via `DateSearchVariables` Event. + +Fixes +----- + +Nothing + +Tasks +----- + +Nothing + +Deprecation +----------- + +Nothing diff --git a/Tests/Unit/Events/Controller/DateSearchVariablesTest.php b/Tests/Unit/Events/Controller/DateSearchVariablesTest.php index dae8bd8..b2fb431 100644 --- a/Tests/Unit/Events/Controller/DateSearchVariablesTest.php +++ b/Tests/Unit/Events/Controller/DateSearchVariablesTest.php @@ -23,6 +23,8 @@ class DateSearchVariablesTest extends TestCase public function canBeCreated(): void { $subject = new DateSearchVariables( + [ + ], [ ], new DateDemand(), @@ -37,12 +39,39 @@ class DateSearchVariablesTest extends TestCase ); } + /** + * @test + */ + public function returnsInitializeSettings(): void + { + $subject = new DateSearchVariables( + [ + 'someCustomKey' => 'someCustomValue', + ], + [ + ], + new DateDemand(), + $this->prophesize(QueryResult::class)->reveal(), + [], + [] + ); + + self::assertSame( + [ + 'someCustomKey' => 'someCustomValue', + ], + $subject->getSettings() + ); + } + /** * @test */ public function returnsInitializeSearch(): void { $subject = new DateSearchVariables( + [ + ], [ 'executed' => '1', ], @@ -67,6 +96,8 @@ class DateSearchVariablesTest extends TestCase { $demand = new DateDemand(); $subject = new DateSearchVariables( + [ + ], [ ], $demand, @@ -88,6 +119,8 @@ class DateSearchVariablesTest extends TestCase { $regions = $this->prophesize(QueryResult::class)->reveal(); $subject = new DateSearchVariables( + [ + ], [ ], new DateDemand(), @@ -108,6 +141,8 @@ class DateSearchVariablesTest extends TestCase public function returnsInitialCategories(): void { $subject = new DateSearchVariables( + [ + ], [ ], new DateDemand(), @@ -132,6 +167,8 @@ class DateSearchVariablesTest extends TestCase public function returnsInitialFeatures(): void { $subject = new DateSearchVariables( + [ + ], [ ], new DateDemand(), @@ -159,6 +196,8 @@ class DateSearchVariablesTest extends TestCase $demand = new DateDemand(); $regions = $this->prophesize(QueryResult::class)->reveal(); $subject = new DateSearchVariables( + [ + ], [ 'executed' => '1', ], @@ -198,6 +237,8 @@ class DateSearchVariablesTest extends TestCase $demand = new DateDemand(); $regions = $this->prophesize(QueryResult::class)->reveal(); $subject = new DateSearchVariables( + [ + ], [ 'executed' => '1', ], @@ -242,6 +283,8 @@ class DateSearchVariablesTest extends TestCase $demand = new DateDemand(); $regions = $this->prophesize(QueryResult::class)->reveal(); $subject = new DateSearchVariables( + [ + ], [ 'executed' => '1', ], diff --git a/ext_emconf.php b/ext_emconf.php index 0ad3069..d55cbdd 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -9,7 +9,7 @@ $EM_CONF['events'] = [ 'state' => 'stable', 'createDirs' => '', 'clearCacheOnLoad' => 0, - 'version' => '3.7.0', + 'version' => '3.8.0', 'constraints' => [ 'depends' => [ 'typo3' => '10.4.00-11.5.99',