nextcloud/apps/files_sharing/tests
Daniel Calviño Sánchez 26cf16d67f
Fix constructor spy in unit test with Sinon 4.1.3
When a constructor is spied using Sinon it is wrapped by a proxy
function, which calls the original constructor when invoked. When "new
Foo()" is executed a "Foo" object is created, "Foo" is invoked with the
object as "this", and the object is returned as the result of the whole
"new" expression.

Before Sinon 4.1.3 the proxy called the original constructor directly
using the "thisValue" of the spied call; "thisValue" was the object
created by the "new" operator that called the proxy. The proxy assigned
"thisValue" to "returnValue", so it was also the value returned by the
proxy and, in turn, the value returned by the whole "new" expression.

Since Sinon 4.1.3 (see pull request 1626) the proxy calls the original
constructor using "new" instead of directly. The "thisValue" created by
the outermost "new" (the one that called the proxy) is no longer used by
the original constructor; the internal "new" creates a new object, which
is the one passed to the original constructor and returned by the
internal "new" expression. This object is also the value returned by the
proxy ("returnValue") and, in turn, the value returned by the whole
outermost "new" expression.

Thus, now "returnValue" should be used instead of "thisValue" to get the
object created by the spied constructor.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2017-12-11 16:49:39 +01:00
..
Command Add CleanupRemoteStorages command 2017-03-17 00:09:52 -06:00
Controller Backport of #5384 to stable12 2017-06-15 19:23:31 +02:00
External Do proper DI 2017-04-11 15:04:01 +02:00
Middleware allow to access mail shares even if public links are disabled 2017-01-04 21:23:26 +01:00
Migration Move the file sharing app to migration 2017-05-12 09:38:48 +02:00
js Fix constructor spy in unit test with Sinon 4.1.3 2017-12-11 16:49:39 +01:00
ApiTest.php update unit tests 2017-04-07 15:43:59 +02:00
BackendTest.php Move Share backends to PSR-4 instead of using class path (#24941) 2016-08-05 14:13:41 +02:00
CacheTest.php Use the correct root for shared jail when the source storage is also a jail 2017-11-28 13:55:42 +01:00
CapabilitiesTest.php move capabilities to share by mail app 2017-04-10 17:18:13 +02:00
DeleteOrphanedSharesJobTest.php Fix apps/ 2016-07-21 18:13:57 +02:00
EncryptedSizePropagationTest.php Update with robin 2016-07-21 18:13:58 +02:00
EtagPropagationTest.php Generate coverage for quick DB tests 2016-10-05 13:55:44 +02:00
ExpireSharesJobTest.php Fix apps/ 2016-07-21 18:13:57 +02:00
ExternalStorageTest.php Add a single public api for resolving a cloud id to a user and remote and back 2017-02-08 15:17:02 +01:00
GroupEtagPropagationTest.php Fix post_unshareFromSelf hook parameter format 2016-10-20 16:09:08 +02:00
HelperTest.php Fix apps/ 2016-07-21 18:13:57 +02:00
LockingTest.php Update with robin 2016-07-21 18:13:58 +02:00
MountProviderTest.php Merge pull request #3884 from nextcloud/downstream-26956 2017-03-20 12:27:38 +01:00
PermissionsTest.php Update with robin 2016-07-21 18:13:58 +02:00
PropagationTestCase.php Update with robin 2016-07-21 18:13:58 +02:00
ShareTest.php Cleanup OC_Group usage a bit 2016-11-04 20:55:47 +01:00
SharedMountTest.php Cleanup OC_Group usage a bit 2016-11-04 20:55:47 +01:00
SharedStorageTest.php set cache to failedcache when shared storage init fails 2017-03-23 15:01:23 +01:00
SizePropagationTest.php only query substorages to calculate the final mtime/size/etag lazily 2016-11-10 13:59:22 +01:00
TestCase.php Remove legacy class OC_Group and OC_User 2017-03-09 17:35:09 -06:00
UnshareChildrenTest.php Update with robin 2016-07-21 18:13:58 +02:00
UpdaterTest.php Fix tests 2016-10-31 17:17:45 +01:00
WatcherTest.php Update with robin 2016-07-21 18:13:58 +02:00