mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
test(files_sharing): adjust mocks of Talk classes
Classes need to exist to be mocked (reflection), thus unknown classes only can be mocked as `stdClass`. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
7115658327
commit
3a99b88917
1 changed files with 19 additions and 7 deletions
|
|
@ -1675,8 +1675,11 @@ class ShareAPIControllerTest extends TestCase {
|
|||
->with('spreed')
|
||||
->willReturn(true);
|
||||
|
||||
$helper = $this->getMockBuilder('\OCA\Talk\Share\Helper\ShareAPIController')
|
||||
->onlyMethods(['canAccessShare'])
|
||||
// This is not possible anymore with PHPUnit 10+
|
||||
// as `setMethods` was removed and now real reflection is used, thus the class needs to exist.
|
||||
// $helper = $this->getMockBuilder('\OCA\Talk\Share\Helper\ShareAPIController')
|
||||
$helper = $this->getMockBuilder(\stdClass::class)
|
||||
->addMethods(['canAccessShare'])
|
||||
->getMock();
|
||||
$helper->method('canAccessShare')
|
||||
->with($share, $this->currentUser)
|
||||
|
|
@ -2492,8 +2495,11 @@ class ShareAPIControllerTest extends TestCase {
|
|||
->with('spreed')
|
||||
->willReturn(true);
|
||||
|
||||
$helper = $this->getMockBuilder('\OCA\Talk\Share\Helper\ShareAPIController')
|
||||
->onlyMethods(['createShare'])
|
||||
// This is not possible anymore with PHPUnit 10+
|
||||
// as `setMethods` was removed and now real reflection is used, thus the class needs to exist.
|
||||
// $helper = $this->getMockBuilder('\OCA\Talk\Share\Helper\ShareAPIController')
|
||||
$helper = $this->getMockBuilder(\stdClass::class)
|
||||
->addMethods(['createShare'])
|
||||
->getMock();
|
||||
$helper->method('createShare')
|
||||
->with(
|
||||
|
|
@ -2598,7 +2604,10 @@ class ShareAPIControllerTest extends TestCase {
|
|||
->with('spreed')
|
||||
->willReturn(true);
|
||||
|
||||
$helper = $this->getMockBuilder('\OCA\Talk\Share\Helper\ShareAPIController')
|
||||
// This is not possible anymore with PHPUnit 10+
|
||||
// as `setMethods` was removed and now real reflection is used, thus the class needs to exist.
|
||||
// $helper = $this->getMockBuilder('\OCA\Talk\Share\Helper\ShareAPIController')
|
||||
$helper = $this->getMockBuilder(\stdClass::class)
|
||||
->addMethods(['createShare'])
|
||||
->getMock();
|
||||
$helper->method('createShare')
|
||||
|
|
@ -5093,8 +5102,11 @@ class ShareAPIControllerTest extends TestCase {
|
|||
->with('spreed')
|
||||
->willReturn(true);
|
||||
|
||||
$helper = $this->getMockBuilder('\OCA\Talk\Share\Helper\ShareAPIController')
|
||||
->onlyMethods(['formatShare', 'canAccessShare'])
|
||||
// This is not possible anymore with PHPUnit 10+
|
||||
// as `setMethods` was removed and now real reflection is used, thus the class needs to exist.
|
||||
// $helper = $this->getMockBuilder('\OCA\Talk\Share\Helper\ShareAPIController')
|
||||
$helper = $this->getMockBuilder(\stdClass::class)
|
||||
->addMethods(['formatShare', 'canAccessShare'])
|
||||
->getMock();
|
||||
$helper->method('formatShare')
|
||||
->with($share)
|
||||
|
|
|
|||
Loading…
Reference in a new issue