/** * @group disconnected * @expectedException \Predis\NotSupportedException * @expectedExceptionMessage WATCH is not supported by the current profile. */ public function testThrowsExceptionOnUnsupportedWatchInProfile() { $profile = $this->getMock('Predis\\Profile\\ProfileInterface'); $profile->expects($this->once())->method('supportsCommands')->with(array('MULTI', 'EXEC', 'DISCARD'))->will($this->returnValue(true)); $profile->expects($this->once())->method('supportsCommand')->with('WATCH')->will($this->returnValue(false)); $connection = $this->getMock('Predis\\Connection\\NodeConnectionInterface'); $client = new Client($connection, array('profile' => $profile)); $tx = new MultiExec($client, array('options' => 'cas')); $tx->watch('foo'); }