public function testRemoveServer() { $id = 42; $server = ['url_hash' => 'url_hash']; $this->dbHandler->expects($this->once())->method('removeServer')->with($id); $this->dbHandler->expects($this->once())->method('getServerById')->with($id)->willReturn($server); $this->dispatcher->expects($this->once())->method('dispatch')->willReturnCallback(function ($eventId, $event) { $this->assertSame($eventId, 'OCP\\Federation\\TrustedServerEvent::remove'); $this->assertInstanceOf('Symfony\\Component\\EventDispatcher\\GenericEvent', $event); $this->assertSame('url_hash', $event->getSubject()); }); $this->trustedServers->removeServer($id); }
/** * add server to the list of trusted ownClouds * * @param int $id * @return DataResponse */ public function removeServer($id) { $this->trustedServers->removeServer($id); return new DataResponse(); }
public function testRemoveServer() { $id = 42; $this->dbHandler->expects($this->once())->method('removeServer')->with($id); $this->trustedServers->removeServer($id); }