/** * @expectedException \Box_Exception */ public function testChange_passwordPasswordsDoNotMatchException() { $service = $this->getMockBuilder('\\Box\\Mod\\Profile\\Service')->getMock(); $service->expects($this->never())->method('changeClientPassword')->will($this->returnValue(true)); $di = new \Box_Di(); $validatorMock = $this->getMockBuilder('\\Box_Validate')->disableOriginalConstructor()->getMock(); $validatorMock->expects($this->atLeastOnce())->method('checkRequiredParamsForArray')->will($this->returnValue(null)); $di['validator'] = $validatorMock; $this->clientApi->setDi($di); $this->clientApi->setService($service); $this->clientApi->setIdentity(new \Model_Client()); $data = array('password_confirm' => '16047a3e69f5245756d73b419348f0c7', 'password' => '7c0f843914b37d6575425f96e3a74061'); $result = $this->clientApi->change_password($data); $this->assertTrue($result); }