Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
b553b43
Make possible to send requests as anonymous users in integration tests
danxuliu Dec 3, 2020
184742e
Make possible to set body in requesttoken requests in integration tests
danxuliu Dec 3, 2020
2cc22a0
Add integration tests for user avatars
danxuliu Dec 3, 2020
1552add
Add integration tests for resized user avatars
danxuliu Dec 4, 2020
b4b3276
Add integration tests for getting guest avatars
danxuliu Dec 7, 2020
1de8dc3
Add getter for generic avatars to IAvatarManager
danxuliu Dec 7, 2020
bcce5a6
Add OCS endpoint for avatars
danxuliu Dec 7, 2020
2522439
Make possible to set body in OCS requests in integration tests
danxuliu Dec 7, 2020
b190431
Add integration tests for getting and setting generic avatars
danxuliu Dec 7, 2020
63cbd7b
fixup! Add OCS endpoint for avatars
danxuliu Dec 9, 2020
a31a7fd
fixup! Add OCS endpoint for avatars
danxuliu Dec 10, 2020
92c9fc0
Make possible to define custom avatar types
danxuliu Dec 10, 2020
a836608
fixup! Add OCS endpoint for avatars
danxuliu Dec 10, 2020
95e0177
Move registration of IAvatarProviders to IRegistrationContext
danxuliu Dec 10, 2020
f04a16a
fixup! Make possible to define custom avatar types
danxuliu Dec 14, 2020
ebf242a
fixup! Add OCS endpoint for avatars
danxuliu Dec 14, 2020
bf9169e
fixup! Add getter for generic avatars to IAvatarManager
danxuliu Dec 14, 2020
1e13309
fixup! Make possible to define custom avatar types
danxuliu Dec 14, 2020
6e43ce7
fixup! Add OCS endpoint for avatars
danxuliu Dec 14, 2020
90ac35d
fixup! Make possible to define custom avatar types
danxuliu Dec 14, 2020
5d0102e
fixup! Move registration of IAvatarProviders to IRegistrationContext
danxuliu Dec 14, 2020
ab910ec
fixup! Move registration of IAvatarProviders to IRegistrationContext
danxuliu Dec 14, 2020
a2c63ff
fixup! Make possible to define custom avatar types
danxuliu Dec 14, 2020
76e4bd2
Move deprecated ILogger to LoggerInterface in avatar private classes
danxuliu Dec 14, 2020
612dbe6
Add explicit providers for user and guest avatars
danxuliu Dec 14, 2020
0e953eb
Remove no longer needed attributes from AvatarManager
danxuliu Dec 14, 2020
0bb311f
Get the avatar provider rather than the avatar itself from the manager
danxuliu Dec 14, 2020
611881b
Add method to get the cache duration of an avatar to IAvatarProvider
danxuliu Dec 14, 2020
6c99a9a
fixup! Add method to get the cache duration of an avatar to IAvatarPr…
danxuliu Dec 14, 2020
6079793
fixup! Add explicit providers for user and guest avatars
danxuliu Dec 15, 2020
bcd2074
fixup! Move registration of IAvatarProviders to IRegistrationContext
danxuliu Dec 15, 2020
23f4c1d
fixup! Get the avatar provider rather than the avatar itself from the…
danxuliu Dec 15, 2020
e88d3b6
fixup! Make possible to define custom avatar types
danxuliu Dec 15, 2020
4a26943
fixup! Add explicit providers for user and guest avatars
danxuliu Dec 15, 2020
fa0342a
fixup! Add explicit providers for user and guest avatars
danxuliu Dec 15, 2020
ebc3f14
fixup! Get the avatar provider rather than the avatar itself from the…
danxuliu Dec 15, 2020
03eed3e
fixup! Add integration tests for getting and setting generic avatars
danxuliu Dec 15, 2020
1348cab
fixup! Add integration tests for getting and setting generic avatars
danxuliu Dec 15, 2020
8d69a4e
fixup! Add OCS endpoint for avatars
danxuliu Dec 15, 2020
4368ec0
fixup! Make possible to define custom avatar types
danxuliu Dec 15, 2020
6b8f290
fixup! Add integration tests for getting and setting generic avatars
danxuliu Dec 15, 2020
68b298e
fixup! Add method to get the cache duration of an avatar to IAvatarPr…
danxuliu Dec 16, 2020
cc7cd18
Split try/catch blocks to catch only the relevant exceptions
danxuliu Dec 16, 2020
6ed5fde
Add method to check if an avatar can be accessed by the current user
danxuliu Dec 16, 2020
65c8c22
Add method to check if an avatar can be modified by the current user
danxuliu Dec 16, 2020
135d14b
Add integration tests for unauthorized modification of avatars
danxuliu Dec 16, 2020
330fac8
Add method to get the version of an avatar
danxuliu Dec 16, 2020
68fa045
Limit the returned sizes of the avatars to a predefined set
danxuliu Dec 16, 2020
601d741
fixup! Get the avatar provider rather than the avatar itself from the…
danxuliu Dec 16, 2020
6391a2b
fixup! Add explicit providers for user and guest avatars
danxuliu Dec 16, 2020
029d22c
fixup! Add method to check if an avatar can be modified by the curren…
danxuliu Dec 16, 2020
3a4b926
fixup! Add explicit providers for user and guest avatars
danxuliu Dec 16, 2020
6895199
fixup! Make possible to define custom avatar types
danxuliu Dec 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make possible to set body in requesttoken requests in integration tests
"sendingAToWithRequesttoken" needs to be used to test some non OCS
endpoints which require the request token to be sent in the request. Now
it is possible to specify the body (or, rather, additional contents
beside the cookies and the request token) for those requests, as it will
be needed for example to upload an avatar.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
  • Loading branch information
danxuliu committed Dec 7, 2020
commit 184742e6ff1fe27ebc663dd1adff9ae87408d87d
24 changes: 17 additions & 7 deletions build/integration/features/bootstrap/BasicStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,21 +307,31 @@ public function loggingInUsingWebAs($user) {
* @When Sending a :method to :url with requesttoken
* @param string $method
* @param string $url
* @param TableNode|array|null $body
*/
public function sendingAToWithRequesttoken($method, $url) {
public function sendingAToWithRequesttoken($method, $url, $body = null) {
$baseUrl = substr($this->baseUrl, 0, -5);

$options = [
'cookies' => $this->cookieJar,
'headers' => [
'requesttoken' => $this->requestToken
],
];

if ($body instanceof TableNode) {
$fd = $body->getRowsHash();
$options['form_params'] = $fd;
} elseif ($body) {
$options = array_merge($options, $body);
}

$client = new Client();
try {
$this->response = $client->request(
$method,
$baseUrl . $url,
[
'cookies' => $this->cookieJar,
'headers' => [
'requesttoken' => $this->requestToken
]
]
$options
);
} catch (ClientException $e) {
$this->response = $e->getResponse();
Expand Down