@@ -177,29 +177,26 @@ public function test_timestamp_workflow()
177177 $ lastLogin ->assertJson (['value ' => $ time ]);
178178 }
179179
180- // /** @test */
181- // public function test_backed_enum_workflow()
182- // {
183- // PreferenceBuilder::init(General::CONFIG, Cast::BACKED_ENUM)
184- // ->withDefaultValue(OtherPreferences::QUALITY)
185- // ->create();
186- //
187- // $status = $this->patch(route('preferences.user.general.update', ['scope_id' => 1, 'preference' => 'config']), ['value' => OtherPreferences::CONFIG->value]);
188- // $status->assertJson(['value' => OtherPreferences::CONFIG]);
189- // }
190- //
191- //
192-
193- //
194- // /** @test */
195- // public function test_object_workflow()
196- // {
197- // // issue: if ($attributes[$key] instanceof Arrayable) {
198- // PreferenceBuilder::init(General::CONFIG, Cast::OBJECT)
199- // ->withDefaultValue($this->adminUser)
200- // ->create();
201- //
202- // $profile = $this->patch(route('preferences.user.profile.update', ['scope_id' => 1, 'preference' => 'config']), ['value' => ['name' => 'Jane Doe', 'email' => '[email protected] ']]); 203- // $profile->assertRedirect();
204- // }
180+ /** @test */
181+ public function test_backed_enum_workflow ()
182+ {
183+ PreferenceBuilder::init (General::CONFIG , Cast::BACKED_ENUM )
184+ ->withDefaultValue (OtherPreferences::QUALITY )
185+ ->create ();
186+
187+ $ config = $ this ->patch (route ('preferences.user.general.update ' , ['scope_id ' => 1 , 'preference ' => 'config ' ]), ['value ' => OtherPreferences::CONFIG ->value ]);
188+ $ config ->assertRedirect ();
189+ }
190+
191+
192+ /** @test */
193+ public function test_object_workflow ()
194+ {
195+ PreferenceBuilder::init (General::CONFIG , Cast::OBJECT )
196+ ->withDefaultValue ($ this ->adminUser )
197+ ->create ();
198+
199+ $ profile =
$ this ->
patch (
route (
'preferences.user.general.update ' , [
'scope_id ' =>
1 ,
'preference ' =>
'config ' ]), [
'value ' => [
'name ' =>
'Jane Doe ' ,
'email ' =>
'[email protected] ' ]]);
200+ $ profile ->assertRedirect ();
201+ }
205202}
0 commit comments