More tests
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Родитель
6b1d560bf9
Коммит
478d24cc75
|
@ -4,6 +4,7 @@ require __DIR__ . '/../../vendor/autoload.php';
|
|||
use Behat\Behat\Context\Context;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Psr7\Response;
|
||||
use PHPUnit\Framework\Assert;
|
||||
|
||||
class FeatureContext implements Context
|
||||
{
|
||||
|
@ -103,8 +104,20 @@ class FeatureContext implements Context
|
|||
'X-LOOL-WOPI-Timestamp' => $this->checkFileInfoResult['LastModifiedTime']
|
||||
]
|
||||
];
|
||||
$result = $client->post($this->baseUrl . 'index.php/apps/richdocuments/wopi/files/' . $this->fileId . '/contents?access_token=' . $this->wopiToken, $options);
|
||||
$this->checkFileInfoResult = json_decode($result->getBody()->getContents(), true);
|
||||
try {
|
||||
$result = $client->post($this->baseUrl . 'index.php/apps/richdocuments/wopi/files/' . $this->fileId . '/contents?access_token=' . $this->wopiToken, $options);
|
||||
$this->checkFileInfoResult = json_decode($result->getBody()->getContents(), true);
|
||||
} catch (\GuzzleHttp\Exception\ClientException $e) {
|
||||
$this->response = $e->getResponse();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^the HTTP status code should be "([^"]*)"$/
|
||||
* @param int $statusCode
|
||||
*/
|
||||
public function theHTTPStatusCodeShouldBe($statusCode) {
|
||||
Assert::assertEquals($statusCode, $this->response->getStatusCode());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -27,6 +27,26 @@ Scenario: Fetch checkFileInfo for public share link
|
|||
And checkFileInfo "UserId" matches "/Guest-/"
|
||||
And checkFileInfo "OwnerId" is "user1"
|
||||
And checkFileInfo "UserCanWrite" is false
|
||||
And Collabora puts "./../assets/template.odt"
|
||||
And the HTTP status code should be "403"
|
||||
|
||||
|
||||
Scenario: Fetch checkFileInfo for public share link with write permission
|
||||
Given as user "user1"
|
||||
And User "user1" uploads file "./../assets/template.odt" to "/file.odt"
|
||||
And as "user1" create a share with
|
||||
| path | /file.odt |
|
||||
| shareType | 3 |
|
||||
And Updating last share with
|
||||
| permissions | 3 |
|
||||
Then Using web as guest
|
||||
And a guest opens the share link
|
||||
And Collabora fetches checkFileInfo
|
||||
And checkFileInfo "BaseFileName" is "file.odt"
|
||||
And checkFileInfo "UserId" matches "/Guest-/"
|
||||
And checkFileInfo "OwnerId" is "user1"
|
||||
And checkFileInfo "UserCanWrite" is true
|
||||
And Collabora puts "./../assets/template.odt"
|
||||
|
||||
Scenario: Save a file as the owner
|
||||
Given as user "user1"
|
||||
|
|
Загрузка…
Ссылка в новой задаче