-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: convert method to get instance of appConfig
Signed-off-by: Vitor Mattos <[email protected]>
- Loading branch information
1 parent
c3fdf4d
commit aaaf647
Showing
14 changed files
with
142 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
|
||
namespace OCA\Libresign\Tests\Api\Controller; | ||
|
||
use OCA\Libresign\AppInfo\Application; | ||
use OCA\Libresign\Tests\Api\ApiTestCase; | ||
|
||
/** | ||
|
@@ -19,8 +20,7 @@ final class FileControllerTest extends ApiTestCase { | |
* @runInSeparateProcess | ||
*/ | ||
public function testValidateUsignUuidWithInvalidData():void { | ||
$this->mockAppConfig([]); | ||
|
||
$this->getMockAppConfig(); | ||
$this->request | ||
->withPath('/api/v1/file/validate/uuid/invalid') | ||
->assertResponseCode(404); | ||
|
@@ -79,12 +79,11 @@ public function testValidateWithSuccessUsingUnloggedUser():void { | |
public function testValidateWithSuccessUsingSigner():void { | ||
$user = $this->createAccount('username', 'password'); | ||
$user->setEMailAddress('[email protected]'); | ||
$this->mockAppConfig([ | ||
'identify_methods' => [ | ||
[ | ||
'name' => 'email', | ||
'enabled' => 1, | ||
], | ||
$appConfig = $this->getMockAppConfig(); | ||
$appConfig->setValueArray(Application::APP_ID, 'identify_methods', [ | ||
[ | ||
'name' => 'email', | ||
'enabled' => 1, | ||
], | ||
]); | ||
|
||
|
@@ -136,9 +135,7 @@ public function testControllerListWithEmptyData():void { | |
*/ | ||
public function testSendNewFile():void { | ||
$this->createAccount('allowrequestsign', 'password'); | ||
$this->mockAppConfig([ | ||
'groups_request_sign' => '["admin","testGroup"]', | ||
]); | ||
$this->getMockAppConfig()->setValueArray(Application::APP_ID, 'groups_request_sign', ['admin','testGroup']); | ||
$this->request | ||
->withRequestHeader([ | ||
'Authorization' => 'Basic ' . base64_encode('allowrequestsign:password'), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
|
||
namespace OCA\Libresign\Tests\Api\Controller; | ||
|
||
use OCA\Libresign\AppInfo\Application; | ||
use OCA\Libresign\Tests\Api\ApiTestCase; | ||
|
||
/** | ||
|
@@ -44,10 +45,9 @@ public function testPostRegisterWithValidationFailure():void { | |
public function testPostRegisterWithSuccess():void { | ||
$this->createAccount('allowrequestsign', 'password', 'testGroup'); | ||
|
||
$this->mockAppConfig([ | ||
'groups_request_sign' => '["admin","testGroup"]', | ||
'notifyUnsignedUser' => 0, | ||
]); | ||
$appConfig = $this->getMockAppConfig(); | ||
$appConfig->setValueArray(Application::APP_ID, 'groups_request_sign', ['admin','testGroup']); | ||
$appConfig->setValueBool(Application::APP_ID, 'notifyUnsignedUser', false); | ||
|
||
$this->request | ||
->withMethod('POST') | ||
|
@@ -104,10 +104,9 @@ public function testPatchRegisterWithValidationFailure():void { | |
public function testPatchRegisterWithSuccess():void { | ||
$user = $this->createAccount('allowrequestsign', 'password', 'testGroup'); | ||
|
||
$this->mockAppConfig([ | ||
'groups_request_sign' => '["admin","testGroup"]', | ||
'notifyUnsignedUser' => 0, | ||
]); | ||
$appConfig = $this->getMockAppConfig(); | ||
$appConfig->setValueArray(Application::APP_ID, 'groups_request_sign', ['admin','testGroup']); | ||
$appConfig->setValueBool(Application::APP_ID, 'notifyUnsignedUser', false); | ||
|
||
$user->setEMailAddress('[email protected]'); | ||
$file = $this->requestSignFile([ | ||
|
Oops, something went wrong.