Merge pull request #2784 from owncloud/php-types-check

[Tests-Only][full-ci] enforce strict type checking for php api tests
This commit is contained in:
Phil Davis
2021-11-29 13:53:34 +05:45
committed by GitHub
4 changed files with 6 additions and 6 deletions
@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* ownCloud * ownCloud
* *
@@ -207,7 +207,7 @@ class ArchiverContext implements Context {
* *
* @throws Exception * @throws Exception
*/ */
public function theDownloadedArchiveShouldContainTheseFiles(string $type, TableNode $expectedFiles) { public function theDownloadedArchiveShouldContainTheseFiles(string $type, TableNode $expectedFiles):void {
$this->featureContext->verifyTableNodeColumns($expectedFiles, ['name', 'content']); $this->featureContext->verifyTableNodeColumns($expectedFiles, ['name', 'content']);
$tempFile = \tempnam(\sys_get_temp_dir(), 'OcAcceptanceTests_'); $tempFile = \tempnam(\sys_get_temp_dir(), 'OcAcceptanceTests_');
\unlink($tempFile); // we only need the name \unlink($tempFile); // we only need the name
@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* ownCloud * ownCloud
* *
@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* ownCloud * ownCloud
* *
@@ -163,7 +163,7 @@ class SpacesContext implements Context {
* @throws Exception * @throws Exception
*/ */
public function getSpaceByNameFromResponse(string $name): array { public function getSpaceByNameFromResponse(string $name): array {
$response = json_decode($this->featureContext->getResponse()->getBody(), true, 512, JSON_THROW_ON_ERROR); $response = json_decode((string)$this->featureContext->getResponse()->getBody(), true, 512, JSON_THROW_ON_ERROR);
$spaceAsArray = $response; $spaceAsArray = $response;
if (isset($response['name']) && $response['name'] === $name) { if (isset($response['name']) && $response['name'] === $name) {
return $response; return $response;
@@ -1,4 +1,4 @@
<?php <?php declare(strict_types=1);
/** /**
* ownCloud * ownCloud
* *