@@ -56,17 +56,17 @@ public function testAddAll()
56
56
{
57
57
$ this ->tableRoom ->addAll ($ key = 1 , $ values = ['foo ' , 'bar ' ]);
58
58
59
- $ this ->assertSame ($ this -> encode ( $ values) , $ this ->tableRoom ->getValue ($ key , $ table = 'sids ' ));
60
- $ this ->assertSame ([$ key ], $ this ->tableRoom ->getValue ($ this -> encode ( 'foo ' ) , 'rooms ' ));
61
- $ this ->assertSame ([$ key ], $ this ->tableRoom ->getValue ($ this -> encode ( 'bar ' ) , 'rooms ' ));
59
+ $ this ->assertSame ($ values , $ this ->tableRoom ->getValue ($ key , $ table = 'sids ' ));
60
+ $ this ->assertSame ([$ key ], $ this ->tableRoom ->getValue ('foo ' , 'rooms ' ));
61
+ $ this ->assertSame ([$ key ], $ this ->tableRoom ->getValue ('bar ' , 'rooms ' ));
62
62
}
63
63
64
64
public function testAdd ()
65
65
{
66
66
$ this ->tableRoom ->add ($ key = 1 , $ value = 'foo ' );
67
67
68
- $ this ->assertSame ([$ this -> encode ( $ value) ], $ this ->tableRoom ->getValue ($ key , $ table = 'sids ' ));
69
- $ this ->assertSame ([$ key ], $ this ->tableRoom ->getValue ($ this -> encode ( $ value) , 'rooms ' ));
68
+ $ this ->assertSame ([$ value ], $ this ->tableRoom ->getValue ($ key , $ table = 'sids ' ));
69
+ $ this ->assertSame ([$ key ], $ this ->tableRoom ->getValue ($ value , 'rooms ' ));
70
70
}
71
71
72
72
public function testDeleteAll ()
@@ -75,18 +75,18 @@ public function testDeleteAll()
75
75
$ this ->tableRoom ->deleteAll ($ key );
76
76
77
77
$ this ->assertSame ([], $ this ->tableRoom ->getValue ($ key , $ table = 'sids ' ));
78
- $ this ->assertSame ([], $ this ->tableRoom ->getValue ($ this -> encode ( 'foo ' ) , 'rooms ' ));
79
- $ this ->assertSame ([], $ this ->tableRoom ->getValue ($ this -> encode ( 'bar ' ) , 'rooms ' ));
78
+ $ this ->assertSame ([], $ this ->tableRoom ->getValue ('foo ' , 'rooms ' ));
79
+ $ this ->assertSame ([], $ this ->tableRoom ->getValue ('bar ' , 'rooms ' ));
80
80
}
81
81
82
82
public function testDelete ()
83
83
{
84
84
$ this ->tableRoom ->addAll ($ key = 1 , $ values = ['foo ' , 'bar ' ]);
85
85
$ this ->tableRoom ->delete ($ key , 'foo ' );
86
86
87
- $ this ->assertSame ([$ this -> encode ( 'bar ' ) ], $ this ->tableRoom ->getValue ($ key , $ table = 'sids ' ));
88
- $ this ->assertSame ([], $ this ->tableRoom ->getValue ($ this -> encode ( 'foo ' ) , 'rooms ' ));
89
- $ this ->assertSame ([$ key ], $ this ->tableRoom ->getValue ($ this -> encode ( 'bar ' ) , 'rooms ' ));
87
+ $ this ->assertSame (['bar ' ], $ this ->tableRoom ->getValue ($ key , $ table = 'sids ' ));
88
+ $ this ->assertSame ([], $ this ->tableRoom ->getValue ('foo ' , 'rooms ' ));
89
+ $ this ->assertSame ([$ key ], $ this ->tableRoom ->getValue ('bar ' , 'rooms ' ));
90
90
}
91
91
92
92
public function testGetRooms ()
@@ -106,17 +106,8 @@ public function testGetClients()
106
106
$ this ->tableRoom ->add ($ keys [1 ], $ room );
107
107
108
108
$ this ->assertSame (
109
- $ this ->tableRoom ->getValue ($ this -> encode ( $ room) , $ table = 'rooms ' ),
109
+ $ this ->tableRoom ->getValue ($ room , $ table = 'rooms ' ),
110
110
$ this ->tableRoom ->getClients ($ room )
111
111
);
112
112
}
113
-
114
- protected function encode ($ keys )
115
- {
116
- $ reflection = new \ReflectionClass ($ this ->tableRoom );
117
- $ method = $ reflection ->getMethod ('encode ' );
118
- $ method ->setAccessible (true );
119
-
120
- return $ method ->invokeArgs ($ this ->tableRoom , [$ keys ]);
121
- }
122
113
}
0 commit comments