From 7e1072c3293ad2dba6eb0ac9bd96493f669e043a Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Mon, 10 Jun 2019 15:13:50 +0300 Subject: [PATCH] fix bugs and test --- Tests/DI/QuartzConfigurationTest.php | 36 +++++++++++++++------------- Tests/Yadm/YadmStoreTest.php | 8 +------ 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/Tests/DI/QuartzConfigurationTest.php b/Tests/DI/QuartzConfigurationTest.php index 568d29b..35773b5 100644 --- a/Tests/DI/QuartzConfigurationTest.php +++ b/Tests/DI/QuartzConfigurationTest.php @@ -15,24 +15,26 @@ public function testShouldImplementConfigurationInterface() public function testShouldReturnDefaultConfig() { - $configuration = new QuartzConfiguration([]); + $configuration = new QuartzConfiguration(); $processor = new Processor(); - $config = $processor->processConfiguration($configuration, [[]]); + $config = $processor->processConfiguration($configuration, [[ + 'yadm_simple_store' => [], + ]]); $expectedConfig = [ - 'store' => [ + 'yadm_simple_store' => [ 'uri' => 'mongodb://localhost:27017', 'uriOptions' => [], 'driverOptions' => [], 'sessionId' => 'quartz', 'dbName' => null, - 'managementLockCol' => 'managementLock', - 'calendarCol' => 'calendar', - 'triggerCol' => 'trigger', - 'firedTriggerCol' => 'firedTrigger', - 'jobCol' => 'job', - 'pausedTriggerCol' => 'pausedTrigger', + 'managementLockCol' => 'quartz_management_lock', + 'calendarCol' => 'quartz_calendar', + 'triggerCol' => 'quartz_trigger', + 'firedTriggerCol' => 'quartz_fired_trigger', + 'jobCol' => 'quartz_job', + 'pausedTriggerCol' => 'quartz_paused_trigger', ], 'misfireThreshold' => 60, ]; @@ -46,25 +48,25 @@ public function testCouldSetConfigurationOptions() $processor = new Processor(); $config = $processor->processConfiguration($configuration, [[ - 'store' => [ + 'yadm_simple_store' => [ 'uri' => 'the-uri', ], 'misfireThreshold' => 120, ]]); $expectedConfig = [ - 'store' => [ + 'yadm_simple_store' => [ 'uri' => 'the-uri', 'uriOptions' => [], 'driverOptions' => [], 'sessionId' => 'quartz', 'dbName' => null, - 'managementLockCol' => 'managementLock', - 'calendarCol' => 'calendar', - 'triggerCol' => 'trigger', - 'firedTriggerCol' => 'firedTrigger', - 'jobCol' => 'job', - 'pausedTriggerCol' => 'pausedTrigger', + 'managementLockCol' => 'quartz_management_lock', + 'calendarCol' => 'quartz_calendar', + 'triggerCol' => 'quartz_trigger', + 'firedTriggerCol' => 'quartz_fired_trigger', + 'jobCol' => 'quartz_job', + 'pausedTriggerCol' => 'quartz_paused_trigger', ], 'misfireThreshold' => 120, ]; diff --git a/Tests/Yadm/YadmStoreTest.php b/Tests/Yadm/YadmStoreTest.php index b01dc00..1f58344 100644 --- a/Tests/Yadm/YadmStoreTest.php +++ b/Tests/Yadm/YadmStoreTest.php @@ -1,7 +1,6 @@ sprintf('mongodb://%s:%s', getenv('MONGODB_HOST'), getenv('MONGODB_PORT')), + 'uri' => sprintf('mongodb://%s:%s/quartz_test', getenv('MONGODB_HOST'), getenv('MONGODB_PORT')), 'dbName' => getenv('MONGODB_DB') ];