Skip to content

Commit

Permalink
Issue CollaboraOnline#43: Normalize spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
donquixote committed Nov 8, 2024
1 parent e20aa29 commit 7d2bdfe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/Controller/WopiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function wopiPutFile(string $id, Request $request) {
\Drupal::logger('cool')->error('Conflict saving file ' . $id . ' wopi: ' . $wopi_stamp->format('c') . ' differs from file: ' . $file_stamp->format('c'));

return new Response(
json_encode([ 'COOLStatusCode' => 1010 ]),
json_encode(['COOLStatusCode' => 1010]),
Response::HTTP_CONFLICT,
['content-type' => 'application/json'],
);
Expand Down Expand Up @@ -224,13 +224,13 @@ function wopiPutFile(string $id, Request $request) {
$reasons[] = 'Save on Exit';
}
if (count($reasons) > 0) {
$save_reason .= ' (' . implode(', ', $reasons) . ')';
$save_reason .= ' (' . implode(', ', $reasons) . ')';
}
\Drupal::logger('cool')->error('Save reason: ' . $save_reason);
$media->setRevisionLogMessage($save_reason);
$media->save();

$payload = json_encode([
$payload = json_encode([
'LastModifiedTime' => $mtime->format('c'),
]);

Expand Down
4 changes: 2 additions & 2 deletions src/Cool/CoolRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
* The full contents of discovery.xml, or FALSE on failure.
*/
function getDiscovery($server) {
$discovery_url = $server.'/hosting/discovery';
$discovery_url = $server . '/hosting/discovery';

$default_config = \Drupal::config('collabora_online.settings');
if ($default_config === null) {
return false;
}
$disable_checks = (bool)$default_config->get('cool')['disable_cert_check'];
$disable_checks = (bool) $default_config->get('cool')['disable_cert_check'];

$stream_context = stream_context_create([
'ssl' => [
Expand Down
4 changes: 2 additions & 2 deletions tests/src/ExistingSiteJavascript/CollaboraIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ public function testCollaboraPreview(): void {

$document_field = $assert_session->waitForElement('css', 'input#document-name-input');
$this->assertNotNull($document_field, 'The document name input was not found after 10 seconds.');
$this->getCurrentPage()->waitFor(10, function() use ($document_field) {
$this->getCurrentPage()->waitFor(10, function () use ($document_field) {
return $document_field->getValue() === 'shopping-list.txt';
});
$this->assertEquals('shopping-list.txt', $document_field->getValue(), 'The document name input did not contain the correct value after 10 seconds.');

$word_count_element = $assert_session->waitForElement('css', 'div#StateWordCount');
$this->assertNotNull($word_count_element, 'The word count element was not found after 10 seconds.');
$this->getCurrentPage()->waitFor(10, function() use ($word_count_element) {
$this->getCurrentPage()->waitFor(10, function () use ($word_count_element) {
return $word_count_element->getText() === '2 words, 18 characters';
});
$this->assertEquals('2 words, 18 characters', $word_count_element->getText(), 'The word count element did not contain the correct text after 10 seconds.');
Expand Down

0 comments on commit 7d2bdfe

Please sign in to comment.