From aaeb83f56837d3aa9513acd2e55018b15ee612e7 Mon Sep 17 00:00:00 2001 From: blair2004 Date: Fri, 3 May 2024 17:27:43 +0000 Subject: [PATCH] Update version to stable --- config/nexopos.php | 2 +- tests/Feature/SaveSettingsTest.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) 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' ] } )