Skip to content

Commit 9f70325

Browse files
committed
wip
1 parent 0012602 commit 9f70325

7 files changed

Lines changed: 31 additions & 29 deletions

File tree

tests/lib/Contacts/ContactsMenu/ContactsStoreTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ public function testGetContactsWithoutFilter(): void {
7777
->with($this->equalTo(''), $this->equalTo(['FN', 'EMAIL']))
7878
->willReturn([
7979
[
80-
'UID' => 123,
80+
'UID' => '123',
8181
],
8282
[
83-
'UID' => 567,
83+
'UID' => '567',
8484
'FN' => 'Darren Roner',
8585
'EMAIL' => [
8686
'darren@roner.au'
@@ -110,7 +110,7 @@ public function testGetContactsHidesOwnEntry(): void {
110110
'UID' => 'user123',
111111
],
112112
[
113-
'UID' => 567,
113+
'UID' => '567',
114114
'FN' => 'Darren Roner',
115115
'EMAIL' => [
116116
'darren@roner.au'
@@ -138,10 +138,10 @@ public function testGetContactsWithoutBinaryImage(): void {
138138
->with($this->equalTo(''), $this->equalTo(['FN', 'EMAIL']))
139139
->willReturn([
140140
[
141-
'UID' => 123,
141+
'UID' => '123',
142142
],
143143
[
144-
'UID' => 567,
144+
'UID' => '567',
145145
'FN' => 'Darren Roner',
146146
'EMAIL' => [
147147
'darren@roner.au'
@@ -167,10 +167,10 @@ public function testGetContactsWithoutAvatarURI(): void {
167167
->with($this->equalTo(''), $this->equalTo(['FN', 'EMAIL']))
168168
->willReturn([
169169
[
170-
'UID' => 123,
170+
'UID' => '123',
171171
],
172172
[
173-
'UID' => 567,
173+
'UID' => '567',
174174
'FN' => 'Darren Roner',
175175
'EMAIL' => [
176176
'darren@roner.au'
@@ -868,7 +868,7 @@ public function testFindOneUser(): void {
868868
->with($this->equalTo('a567'), $this->equalTo(['UID']))
869869
->willReturn([
870870
[
871-
'UID' => 123,
871+
'UID' => '123',
872872
'isLocalSystemBook' => false
873873
],
874874
[
@@ -899,7 +899,7 @@ public function testFindOneEMail(): void {
899899
->with($this->equalTo('darren@roner.au'), $this->equalTo(['EMAIL']))
900900
->willReturn([
901901
[
902-
'UID' => 123,
902+
'UID' => '123',
903903
'isLocalSystemBook' => false
904904
],
905905
[
@@ -939,7 +939,7 @@ public function testFindOneNoMatches(): void {
939939
->with($this->equalTo('a567'), $this->equalTo(['UID']))
940940
->willReturn([
941941
[
942-
'UID' => 123,
942+
'UID' => '123',
943943
'isLocalSystemBook' => false
944944
],
945945
[

tests/lib/Files/Mount/MountPointTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function testGetStorage(): void {
1818
$storage = $this->createMock(Storage::class);
1919
$storage->expects($this->once())
2020
->method('getId')
21-
->willReturn(123);
21+
->willReturn('123');
2222

2323
$loader = $this->createMock(StorageFactory::class);
2424
$loader->expects($this->once())
@@ -34,7 +34,7 @@ public function testGetStorage(): void {
3434
);
3535

3636
$this->assertEquals($storage, $mountPoint->getStorage());
37-
$this->assertEquals(123, $mountPoint->getStorageId());
37+
$this->assertEquals('123', $mountPoint->getStorageId());
3838
$this->assertEquals('/mountpoint/', $mountPoint->getMountPoint());
3939

4040
$mountPoint->setMountPoint('another');

tests/lib/Files/ViewTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,6 +1750,8 @@ public function basicOperationProviderForLocks() {
17501750
ILockingProvider::LOCK_SHARED,
17511751
ILockingProvider::LOCK_EXCLUSIVE,
17521752
ILockingProvider::LOCK_SHARED,
1753+
null,
1754+
0,
17531755
],
17541756

17551757
// ---- delete hook ----
@@ -2515,7 +2517,7 @@ public function testRemoveMoveableMountPoint(): void {
25152517
->willReturn($mountPoint);
25162518
$mount->expects($this->once())
25172519
->method('removeMount')
2518-
->willReturn('foo');
2520+
->willReturn(true);
25192521
$mount->expects($this->any())
25202522
->method('getInternalPath')
25212523
->willReturn('');
@@ -2548,7 +2550,7 @@ public function testRemoveMoveableMountPoint(): void {
25482550

25492551
//Delete the mountpoint
25502552
$view = new View('/' . $this->user . '/files');
2551-
$this->assertEquals('foo', $view->rmdir('mount'));
2553+
$this->assertEquals(true, $view->rmdir('mount'));
25522554
}
25532555

25542556
public function mimeFilterProvider() {

tests/lib/Template/ResourceLocatorTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ public function testFind(): void {
4141
$locator = $this->getResourceLocator('theme');
4242
$locator->expects($this->once())
4343
->method('doFind')
44-
->with('foo');
44+
->with('app/foo');
4545
$locator->expects($this->once())
4646
->method('doFindTheme')
47-
->with('foo');
47+
->with('app/foo');
4848
/** @var \OC\Template\ResourceLocator $locator */
49-
$locator->find(['foo']);
49+
$locator->find(['app/foo']);
5050
}
5151

5252
public function testFindNotFound(): void {
@@ -59,17 +59,17 @@ public function testFindNotFound(): void {
5959
['core' => 'map'], ['3rd' => 'party'], ['foo' => 'bar']);
6060
$locator->expects($this->once())
6161
->method('doFind')
62-
->with('foo')
63-
->will($this->throwException(new ResourceNotFoundException('foo', 'map')));
62+
->with('app/foo')
63+
->will($this->throwException(new ResourceNotFoundException('app/foo', 'map')));
6464
$locator->expects($this->once())
6565
->method('doFindTheme')
66-
->with('foo')
67-
->will($this->throwException(new ResourceNotFoundException('foo', 'map')));
66+
->with('app/foo')
67+
->will($this->throwException(new ResourceNotFoundException('app/foo', 'map')));
6868
$this->logger->expects($this->exactly(2))
6969
->method('debug')
70-
->with($this->stringContains('map/foo'));
70+
->with($this->stringContains('map/app/foo'));
7171
/** @var \OC\Template\ResourceLocator $locator */
72-
$locator->find(['foo']);
72+
$locator->find(['app/foo']);
7373
}
7474

7575
public function testAppendIfExist(): void {

tests/lib/TemplateFunctionsTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,12 @@ public function testRelativeDateLastYear(): void {
170170
public function testRelativeDateYearsAgo(): void {
171171
$currentTime = 1380703592;
172172
$elementTime = $currentTime - 86400 * 365.25 * 2;
173-
$result = (string)relative_modified_date($elementTime, $currentTime, true);
173+
$result = (string)relative_modified_date((int)$elementTime, $currentTime, true);
174174

175175
$this->assertEquals('2 years ago', $result);
176176

177177
$elementTime = $currentTime - 86400 * 365.25 * 3;
178-
$result = (string)relative_modified_date($elementTime, $currentTime, true);
178+
$result = (string)relative_modified_date((int)$elementTime, $currentTime, true);
179179

180180
$this->assertEquals('3 years ago', $result);
181181
}
@@ -264,12 +264,12 @@ public function testRelativeTimeLastYear(): void {
264264
public function testRelativeTimeYearsAgo(): void {
265265
$currentTime = 1380703592;
266266
$elementTime = $currentTime - 86400 * 365.25 * 2;
267-
$result = (string)relative_modified_date($elementTime, $currentTime, false);
267+
$result = (string)relative_modified_date((int)$elementTime, $currentTime, false);
268268

269269
$this->assertEquals('2 years ago', $result);
270270

271271
$elementTime = $currentTime - 86400 * 365.25 * 3;
272-
$result = (string)relative_modified_date($elementTime, $currentTime, false);
272+
$result = (string)relative_modified_date((int)$elementTime, $currentTime, false);
273273

274274
$this->assertEquals('3 years ago', $result);
275275
}

tests/lib/User/ManagerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public function testCheckPassword(): void {
154154
$backend->expects($this->once())
155155
->method('checkPassword')
156156
->with($this->equalTo('foo'), $this->equalTo('bar'))
157-
->willReturn(true);
157+
->willReturn('foo');
158158

159159
$backend->expects($this->any())
160160
->method('implementsActions')

tests/lib/User/SessionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ public function testCreateRememberedSessionToken(): void {
970970
->method('generateToken')
971971
->with($sessionId, $uid, $loginName, $password, 'Firefox', IToken::TEMPORARY_TOKEN, IToken::REMEMBER);
972972

973-
$this->assertTrue($userSession->createSessionToken($request, $uid, $loginName, $password, true));
973+
$this->assertTrue($userSession->createSessionToken($request, $uid, $loginName, $password, IToken::REMEMBER));
974974
}
975975

976976
public function testCreateSessionTokenWithTokenPassword(): void {

0 commit comments

Comments
 (0)