@@ -42,7 +42,7 @@ public function testMasterClient()
4242 $ master = $ this ->sentinel ->getMasterClient ($ this ->sentinelConfig ->clustername );
4343 $ this ->assertInstanceOf ('Credis_Client ' ,$ master );
4444 $ this ->assertEquals ($ this ->redisConfig [0 ]['port ' ],$ master ->getPort ());
45- $ this ->expectException ('CredisException ' ,'Master not found ' );
45+ $ this ->setExpectedExceptionShim ('CredisException ' ,'Master not found ' );
4646 $ this ->sentinel ->getMasterClient ('non-existing-cluster ' );
4747 }
4848 public function testMasters ()
@@ -73,7 +73,7 @@ public function testMaster()
7373 $ this ->assertEquals ($ this ->sentinelConfig ->clustername ,$ master [1 ]);
7474 $ this ->assertEquals ($ this ->redisConfig [0 ]['port ' ],$ master [5 ]);
7575
76- $ this ->expectException ('CredisException ' ,'No such master with that name ' );
76+ $ this ->setExpectedExceptionShim ('CredisException ' ,'No such master with that name ' );
7777 $ this ->sentinel ->master ('non-existing-cluster ' );
7878 }
7979 public function testSlaveClient ()
@@ -84,7 +84,7 @@ public function testSlaveClient()
8484 foreach ($ slaves as $ slave ){
8585 $ this ->assertInstanceOf ('Credis_Client ' ,$ slave );
8686 }
87- $ this ->expectException ('CredisException ' ,'No such master with that name ' );
87+ $ this ->setExpectedExceptionShim ('CredisException ' ,'No such master with that name ' );
8888 $ this ->sentinel ->getSlaveClients ('non-existing-cluster ' );
8989 }
9090 public function testSlaves ()
@@ -100,12 +100,12 @@ public function testSlaves()
100100 $ this ->assertInternalType ('array ' ,$ slaves );
101101 $ this ->assertCount (0 ,$ slaves );
102102
103- $ this ->expectException ('CredisException ' ,'No such master with that name ' );
103+ $ this ->setExpectedExceptionShim ('CredisException ' ,'No such master with that name ' );
104104 $ this ->sentinel ->slaves ('non-existing-cluster ' );
105105 }
106106 public function testNonExistingClusterNameWhenCreatingSlaves ()
107107 {
108- $ this ->expectException ('CredisException ' ,'No such master with that name ' );
108+ $ this ->setExpectedExceptionShim ('CredisException ' ,'No such master with that name ' );
109109 $ this ->sentinel ->createSlaveClients ('non-existing-cluster ' );
110110 }
111111 public function testCreateCluster ()
@@ -116,7 +116,7 @@ public function testCreateCluster()
116116 $ cluster = $ this ->sentinel ->createCluster ($ this ->sentinelConfig ->clustername ,0 ,1 ,false );
117117 $ this ->assertInstanceOf ('Credis_Cluster ' ,$ cluster );
118118 $ this ->assertCount (2 ,$ cluster ->clients ());
119- $ this ->expectException ('CredisException ' ,'The master is down ' );
119+ $ this ->setExpectedExceptionShim ('CredisException ' ,'The master is down ' );
120120 $ this ->sentinel ->createCluster ($ this ->sentinelConfig ->downclustername );
121121 }
122122 public function testGetCluster ()
@@ -155,7 +155,7 @@ public function testGetHostAndPort()
155155 $ host = 'localhost ' ;
156156 $ port = '123456 ' ;
157157
158- $ client = $ this ->createMock ('\Credis_Client ' );
158+ $ client = $ this ->createMockShim ('\Credis_Client ' );
159159 $ sentinel = new Credis_Sentinel ($ client );
160160
161161 $ client ->expects ($ this ->once ())->method ('getHost ' )->willReturn ($ host );
@@ -166,7 +166,7 @@ public function testGetHostAndPort()
166166 }
167167 public function testNonExistingMethod ()
168168 {
169- $ this ->expectException ('CredisException ' ,'Unknown sentinel subcommand \'bla \'' );
169+ $ this ->setExpectedExceptionShim ('CredisException ' ,'Unknown sentinel subcommand \'bla \'' );
170170 $ this ->sentinel ->bla ();
171171 }
172172}
0 commit comments