@@ -145,39 +145,52 @@ public function testAddStat()
145145 {
146146 $ expectedStats = $ this ->facet ->getLocalParameters ()->getStats ();
147147 $ expectedStats [] = 'newstat ' ;
148- $ this ->facet ->getLocalParameters ()->setStat ('newstat ' );
148+ $ this ->facet ->addStat ('newstat ' );
149+ $ this ->assertSame ($ expectedStats , $ this ->facet ->getStats ());
149150 $ this ->assertSame ($ expectedStats , $ this ->facet ->getLocalParameters ()->getStats ());
150151 }
151152
152153 public function testClearStats ()
153154 {
154- $ this ->facet ->getLocalParameters ()->setStat ('newstat ' );
155- $ this ->facet ->getLocalParameters ()->clearStats ();
155+ $ this ->facet ->addStat ('newstat ' );
156+ $ this ->facet ->clearStats ();
157+ $ this ->assertSame ([], $ this ->facet ->getStats ());
156158 $ this ->assertSame ([], $ this ->facet ->getLocalParameters ()->getStats ());
157159 }
158160
159161 public function testAddStats ()
160162 {
161163 $ stats = ['stat1 ' , 'stat2 ' ];
162164
163- $ this ->facet ->getLocalParameters ()->clearStats ();
164- $ this ->facet ->getLocalParameters ()->addStats ($ stats );
165+ $ this ->facet ->clearStats ();
166+ $ this ->facet ->addStats ($ stats );
167+ $ this ->assertSame ($ stats , $ this ->facet ->getStats ());
165168 $ this ->assertSame ($ stats , $ this ->facet ->getLocalParameters ()->getStats ());
166169 }
167170
171+ public function testAddStatsAsString ()
172+ {
173+ $ this ->facet ->clearStats ();
174+ $ this ->facet ->addStats ('stat1, stat2 ' );
175+ $ this ->assertSame (['stat1 ' , 'stat2 ' ], $ this ->facet ->getStats ());
176+ $ this ->assertSame (['stat1 ' , 'stat2 ' ], $ this ->facet ->getLocalParameters ()->getStats ());
177+ }
178+
168179 public function testRemoveStat ()
169180 {
170- $ this ->facet ->getLocalParameters ()->clearStats ();
171- $ this ->facet ->getLocalParameters ()->addStats (['stat1 ' , 'stat2 ' ]);
172- $ this ->facet ->getLocalParameters ()->removeStat ('stat1 ' );
181+ $ this ->facet ->clearStats ();
182+ $ this ->facet ->addStats (['stat1 ' , 'stat2 ' ]);
183+ $ this ->facet ->removeStat ('stat1 ' );
184+ $ this ->assertSame (['stat2 ' ], $ this ->facet ->getStats ());
173185 $ this ->assertSame (['stat2 ' ], $ this ->facet ->getLocalParameters ()->getStats ());
174186 }
175187
176188 public function testSetStats ()
177189 {
178- $ this ->facet ->getLocalParameters ()-> clearStats ();
179- $ this ->facet ->getLocalParameters ()-> setStats (['stat1 ' , 'stat2 ' ]);
180- $ this ->facet ->getLocalParameters ()-> setStats (['stat3 ' , 'stat4 ' ]);
190+ $ this ->facet ->clearStats ();
191+ $ this ->facet ->setStats (['stat1 ' , 'stat2 ' ]);
192+ $ this ->facet ->setStats (['stat3 ' , 'stat4 ' ]);
181193 $ this ->assertSame (['stat3 ' , 'stat4 ' ], $ this ->facet ->getStats ());
194+ $ this ->assertSame (['stat3 ' , 'stat4 ' ], $ this ->facet ->getLocalParameters ()->getStats ());
182195 }
183196}
0 commit comments