getMockBuilder('OCA\Federation\DbHandler')->disableOriginalConstructor()->getMock(); $db->method('auth')->willReturn(true); $auth = new FedAuth($db); $result = $this->invokePrivate($auth, 'validateUserPass', [$user, $password]); $this->assertEquals($expected, $result); } public function providesUser() { return [ [true, 'system', '123456'] ]; } }