File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,10 +37,24 @@ protected function setUp(): void
3737 $ this ->handler = CacheFactory ::getHandler (new Cache (), 'memcached ' );
3838 }
3939
40+ /**
41+ * @return list<string>
42+ */
43+ private static function getKeyArray (): array
44+ {
45+ return [
46+ self ::$ key1 ,
47+ self ::$ key2 ,
48+ self ::$ key3 ,
49+ ];
50+ }
51+
4052 protected function tearDown (): void
4153 {
4254 if (isset ($ this ->handler )) {
43- $ this ->handler ->clean ();
55+ foreach (self ::getKeyArray () as $ key ) {
56+ $ this ->handler ->delete ($ key );
57+ }
4458 }
4559
4660 parent ::tearDown ();
Original file line number Diff line number Diff line change @@ -35,10 +35,25 @@ protected function setUp(): void
3535 $ this ->handler = CacheFactory ::getHandler ($ this ->config , 'predis ' );
3636 }
3737
38+ /**
39+ * @return list<string>
40+ */
41+ private static function getKeyArray (): array
42+ {
43+ return [
44+ self ::$ key1 ,
45+ self ::$ key2 ,
46+ self ::$ key3 ,
47+ 'counter ' ,
48+ ];
49+ }
50+
3851 protected function tearDown (): void
3952 {
4053 if (isset ($ this ->handler )) {
41- $ this ->handler ->clean ();
54+ foreach (self ::getKeyArray () as $ key ) {
55+ $ this ->handler ->delete ($ key );
56+ }
4257 }
4358
4459 parent ::tearDown ();
Original file line number Diff line number Diff line change @@ -40,10 +40,25 @@ protected function setUp(): void
4040 $ this ->handler = CacheFactory ::getHandler ($ this ->config , 'redis ' );
4141 }
4242
43+ /**
44+ * @return list<string>
45+ */
46+ private static function getKeyArray (): array
47+ {
48+ return [
49+ self ::$ key1 ,
50+ self ::$ key2 ,
51+ self ::$ key3 ,
52+ 'counter ' ,
53+ ];
54+ }
55+
4356 protected function tearDown (): void
4457 {
4558 if (isset ($ this ->handler )) {
46- $ this ->handler ->clean ();
59+ foreach (self ::getKeyArray () as $ key ) {
60+ $ this ->handler ->delete ($ key );
61+ }
4762 }
4863
4964 parent ::tearDown ();
Original file line number Diff line number Diff line change @@ -127,13 +127,6 @@ public function testWriteAndReadBack(): void
127127 $ handler2 ->open ($ this ->sessionSavePath , $ this ->sessionName );
128128
129129 $ readData = $ handler2 ->read ($ sessionId );
130- if ($ readData !== $ data ) {
131- // Under parallel test execution, Cache component may flush Memcached.
132- // Retry write and read back once if an external flush occurred.
133- $ handler2 ->write ($ sessionId , $ data );
134- $ readData = $ handler2 ->read ($ sessionId );
135- }
136-
137130 $ this ->assertSame ($ data , $ readData );
138131
139132 $ handler2 ->destroy ($ sessionId );
You can’t perform that action at this time.
0 commit comments