diff --git a/config/nexopos.php b/config/nexopos.php index 94eb64a0c..ac1d77242 100644 --- a/config/nexopos.php +++ b/config/nexopos.php @@ -9,7 +9,7 @@ * This is the core version of NexoPOS. This is used to displays on the * dashboard and to ensure a compatibility with the modules. */ - 'version' => '5.2.4-b3', + 'version' => '5.2.4', /** * -------------------------------------------------------------------- diff --git a/tests/Feature/SaveSettingsTest.php b/tests/Feature/SaveSettingsTest.php index 18e03ac9c..9b7508be6 100644 --- a/tests/Feature/SaveSettingsTest.php +++ b/tests/Feature/SaveSettingsTest.php @@ -44,6 +44,11 @@ public function testSaveSettings() return [ $key => collect( $value[ 'fields' ] ) ->mapWithKeys( function ( $field ) { + + if ( $field[ 'type' ] === 'select' && ! empty( $field[ 'options' ] ) ) { + $rawField = collect( $field[ 'options' ] )->random(); + } + return [ $field[ 'name' ] => match ( $field[ 'name' ] ) { 'ns_store_language' => 'en', @@ -57,7 +62,7 @@ public function testSaveSettings() default => ( match ( $field[ 'type' ] ) { 'text', 'textarea' => strstr( $field[ 'name' ], 'email' ) ? $this->faker->email() : $this->faker->text( 20 ), - 'select' => ! empty( $field[ 'options' ] ) ? collect( $field[ 'options' ] )->random()[ 'value' ] : '', + 'select' => ! empty( $field[ 'options' ] ) ? ( $rawField ? $rawField[ 'value' ] : '' ) : '', default => $field[ 'value' ] } )