diff --git a/tests/src/Object/Api/Mastodon/PreferencesTest.php b/tests/src/Object/Api/Mastodon/PreferencesTest.php new file mode 100644 index 0000000000..01cdea13be --- /dev/null +++ b/tests/src/Object/Api/Mastodon/PreferencesTest.php @@ -0,0 +1,46 @@ + 'visibility', + 'posting:default:sensitive' => true, + 'posting:default:language' => 'language', + 'reading:expand:media' => 'media', + 'reading:expand:spoilers' => false, + ], + $preferences->toArray(), + ); + } + + public function testJsonSerializeReturnsArray(): void + { + $preferences = new Preferences('visibility',true, 'language', 'media', false); + + self::assertSame( + [ + 'posting:default:visibility' => 'visibility', + 'posting:default:sensitive' => true, + 'posting:default:language' => 'language', + 'reading:expand:media' => 'media', + 'reading:expand:spoilers' => false, + ], + $preferences->jsonSerialize(), + ); + } +}