@@ -57,6 +57,70 @@ public function testGetWithContext(): void
5757 $ this ->assertSame ('YesContext ' , $ this ->settings ->get ('Example.siteName ' , 'testing:true ' ));
5858 }
5959
60+ public function testGetManyReturnsMultipleValues (): void
61+ {
62+ $ this ->settings ->setMany ([
63+ 'Example.siteName ' => 'BatchName ' ,
64+ 'Example.siteEmail ' => 'batch@example.com ' ,
65+ ]);
66+
67+ $ this ->assertSame ([
68+ 'Example.siteName ' => 'BatchName ' ,
69+ 'Example.siteEmail ' => 'batch@example.com ' ,
70+ ], $ this ->settings ->getMany ([
71+ 'Example.siteName ' ,
72+ 'Example.siteEmail ' ,
73+ ]));
74+ }
75+
76+ public function testGetManyFallsBackToConfigValues (): void
77+ {
78+ $ this ->assertSame ([
79+ 'Example.siteName ' => 'Settings Test ' ,
80+ 'Example.siteEmail ' => null ,
81+ ], $ this ->settings ->getMany ([
82+ 'Example.siteName ' ,
83+ 'Example.siteEmail ' ,
84+ ]));
85+ }
86+
87+ public function testGetManyWithContext (): void
88+ {
89+ $ this ->settings ->setMany ([
90+ 'Example.siteName ' => 'NoContext ' ,
91+ 'Example.siteEmail ' => 'general@example.com ' ,
92+ ]);
93+ $ this ->settings ->setMany ([
94+ 'Example.siteName ' => 'YesContext ' ,
95+ ], 'testing:true ' );
96+
97+ $ this ->assertSame ([
98+ 'Example.siteName ' => 'YesContext ' ,
99+ 'Example.siteEmail ' => 'general@example.com ' ,
100+ ], $ this ->settings ->getMany ([
101+ 'Example.siteName ' ,
102+ 'Example.siteEmail ' ,
103+ ], 'testing:true ' ));
104+ }
105+
106+ public function testGetManyPreservesRequestedKeys (): void
107+ {
108+ $ this ->settings ->set ('Example.siteName ' , 'BatchName ' );
109+
110+ $ this ->assertSame ([
111+ Example::class . '.siteName ' => 'BatchName ' ,
112+ 'Nada.siteName ' => null ,
113+ ], $ this ->settings ->getMany ([
114+ Example::class . '.siteName ' ,
115+ 'Nada.siteName ' ,
116+ ]));
117+ }
118+
119+ public function testGetManyAcceptsEmptyArray (): void
120+ {
121+ $ this ->assertSame ([], $ this ->settings ->getMany ([]));
122+ }
123+
60124 public function testSetManyStoresMultipleValues (): void
61125 {
62126 $ this ->settings ->setMany ([
0 commit comments