{"comment":{"url":"https://api.github.com/repos/owncloud/core/comments/10526888","html_url":"https://github.com/owncloud/core/commit/70579eeea6ffe18bcfddd9fd7513bb6bc0d97374#commitcomment-10526888","id":10526888,"user":{"login":"schiesbn","id":1589737,"avatar_url":"https://avatars.githubusercontent.com/u/1589737?v=3","gravatar_id":"","url":"https://api.github.com/users/schiesbn","html_url":"https://github.com/schiesbn","followers_url":"https://api.github.com/users/schiesbn/followers","following_url":"https://api.github.com/users/schiesbn/following{/other_user}","gists_url":"https://api.github.com/users/schiesbn/gists{/gist_id}","starred_url":"https://api.github.com/users/schiesbn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schiesbn/subscriptions","organizations_url":"https://api.github.com/users/schiesbn/orgs","repos_url":"https://api.github.com/users/schiesbn/repos","events_url":"https://api.github.com/users/schiesbn/events{/privacy}","received_events_url":"https://api.github.com/users/schiesbn/received_events","type":"User","site_admin":false},"position":111,"line":137,"path":"apps/encryption/tests/lib/KeyManagerTest.php","commit_id":"70579eeea6ffe18bcfddd9fd7513bb6bc0d97374","created_at":"2015-04-01T15:55:43Z","updated_at":"2015-04-01T15:55:43Z","body":"But the mocks need to be different depending from the test we want to execute, e.g.\r\n\r\n````\r\n\t\t$this->keyStorageMock->expects($this->any())\r\n\t\t\t->method('getUserKey')\r\n\t\t\t->with($this->equalTo($this->userId), $this->equalTo('privateKey'))\r\n\t\t\t->willReturn('privateKey');\r\n````\r\n\r\nfor testGetPrivateKey() and\r\n\r\n````\r\n\t\t$this->keyStorageMock->expects($this->any())\r\n\t\t\t->method('getUserKey')\r\n\t\t\t->with($this->equalTo($this->userId), $this->equalTo('publicKey'))\r\n\t\t\t->willReturn('publicKey');\r\n````\r\n\r\nfor testGetPublicKey().\r\n\r\nHow would you do this in setUp(), initialize the keymanager with the right mock depending on the test which will be executed after setUp() ?"}}