@@ -63,6 +63,36 @@ public function testPut()
6363 $ this ->assertSame ('Donburi ' , $ this ->getOlderStore ()->get ('rice ' ));
6464 }
6565
66+ /**
67+ * test of forget().
68+ *
69+ * @return void
70+ */
71+ public function testForget ()
72+ {
73+ $ this ->getOlderStore ()->put ('Donburi ' , 'jp ' );
74+ $ this ->getOlderStore ()->put ('risotto ' , 'it ' );
75+
76+ $ this ->getOlderStore ()->forget ('risotto ' );
77+ $ this ->assertSame ('jp ' , $ this ->getOlderStore ()->get ('Donburi ' ));
78+ $ this ->assertNull ($ this ->getOlderStore ()->get ('risotto ' ));
79+ }
80+
81+ /**
82+ * test of flush().
83+ *
84+ * @return void
85+ */
86+ public function testFlush ()
87+ {
88+ $ this ->getOlderStore ()->put ('Donburi ' , 'jp ' );
89+ $ this ->getOlderStore ()->put ('risotto ' , 'it ' );
90+
91+ $ this ->getOlderStore ()->flush ();
92+ $ this ->assertNull ($ this ->getOlderStore ()->get ('Donburi ' ));
93+ $ this ->assertNull ($ this ->getOlderStore ()->get ('risotto ' ));
94+ }
95+
6696 /**
6797 * test of getTwin().
6898 *
@@ -114,4 +144,42 @@ public function testPutTwin()
114144 $ this ->assertSame ('random ' , $ this ->getOlderStore ()->get ('forest ' ));
115145 $ this ->assertSame ('random ' , $ this ->getYoungerStore ()->get ('forest ' ));
116146 }
147+
148+ /**
149+ * test of forgetTwin().
150+ *
151+ * @return void
152+ */
153+ public function testForgetTwin ()
154+ {
155+ $ this ->getOlderStore ()->put ('Donburi ' , 'jp ' );
156+ $ this ->getOlderStore ()->put ('risotto ' , 'it ' );
157+ $ this ->getYoungerStore ()->put ('Donburi ' , 'jp ' );
158+ $ this ->getYoungerStore ()->put ('risotto ' , 'it ' );
159+
160+ $ this ->getTwinStore ()->forgetTwin ('risotto ' );
161+ $ this ->assertSame ('jp ' , $ this ->getOlderStore ()->get ('Donburi ' ));
162+ $ this ->assertNull ($ this ->getOlderStore ()->get ('risotto ' ));
163+ $ this ->assertSame ('jp ' , $ this ->getYoungerStore ()->get ('Donburi ' ));
164+ $ this ->assertNull ($ this ->getYoungerStore ()->get ('risotto ' ));
165+ }
166+
167+ /**
168+ * test of flushTwin().
169+ *
170+ * @return void
171+ */
172+ public function testFlushTwin ()
173+ {
174+ $ this ->getOlderStore ()->put ('Donburi ' , 'jp ' );
175+ $ this ->getOlderStore ()->put ('risotto ' , 'it ' );
176+ $ this ->getYoungerStore ()->put ('Donburi ' , 'jp ' );
177+ $ this ->getYoungerStore ()->put ('risotto ' , 'it ' );
178+
179+ $ this ->getTwinStore ()->flushTwin ();
180+ $ this ->assertNull ($ this ->getOlderStore ()->get ('Donburi ' ));
181+ $ this ->assertNull ($ this ->getOlderStore ()->get ('risotto ' ));
182+ $ this ->assertNull ($ this ->getYoungerStore ()->get ('Donburi ' ));
183+ $ this ->assertNull ($ this ->getYoungerStore ()->get ('risotto ' ));
184+ }
117185}
0 commit comments