Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

declare(strict_types=1);

require_once './vendor/autoload.php';
require_once './vendor-bin/coding-standard/vendor/autoload.php';

use Nextcloud\CodingStandard\Config;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;

$config = new Config();
$config
->setParallelConfig(ParallelConfigFactory::detect())
->getFinder()
->ignoreVCSIgnored(true)
->notPath('vendor')
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
]
},
"require": {
"php": ">=8.1",
"php": ">=8.2",
"guzzlehttp/guzzle": "^7.10",
"phpunit/phpunit": "*",
"behat/behat": "^3.29",
"libresign/behat-builtin-extension": "^0.6.3",
"libresign/behat-builtin-extension": "^0.7.0",
"estahn/json-query-wrapper": "*"
},
"require-dev": {
Expand Down
4 changes: 2 additions & 2 deletions features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ private function hasNestedPayload(array $payload): bool {
public function setTheResponseTo(PyStringNode $response): void {
// Mock response to be equal to body of request
$this->mockServer->setDefaultResponse(new MockWebServerResponse(
(string) $response
(string)$response
));
}

#[Given('set the response with :header header :value to:')]
public function setTheResponseWithHeaderTo(string $header, string $value, PyStringNode $response): void {
$this->mockServer->setDefaultResponse(new MockWebServerResponse(
(string) $response,
(string)$response,
[$header => $value]
));
}
Expand Down
20 changes: 10 additions & 10 deletions src/NextcloudApiContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ public function __construct(?array $parameters = []) {

#[BeforeSuite()]
public static function beforeSuite(BeforeSuiteScope $scope):void {
$whoami = (string) exec('whoami');
$whoami = (string)exec('whoami');
if (get_current_user() !== $whoami) {
$command = implode(' ', $_SERVER['argv'] ?? []);
throw new Exception(sprintf(
"Have files that %s is the owner and the user that is running this test is %s, is necessary to be the same user.\n" .
"You should run the follow command:\n" .
"runuser -u %s -- %s\n\n",
"Have files that %s is the owner and the user that is running this test is %s, is necessary to be the same user.\n"
. "You should run the follow command:\n"
. "runuser -u %s -- %s\n\n",
get_current_user(), $whoami, get_current_user(), $command));
}
}
Expand Down Expand Up @@ -256,7 +256,7 @@ public function sendRequest(string $verb, string $url, $body = null, array $head
}

try {
list($fullUrl, $options) = $this->beforeRequest($fullUrl, $options);
[$fullUrl, $options] = $this->beforeRequest($fullUrl, $options);
$options = $this->normalizePayloadForRequest($verb, $options);
$this->requestOptions = $options;
$this->response = $client->{$verb}($fullUrl, $options);
Expand Down Expand Up @@ -498,12 +498,12 @@ public function theResponseShouldContainTheInitialStateWithTheFollowingValues(st
}
$element = $dom->getElementById('initial-state-' . $name);
if (!$element) {
throw new \Exception('Initial state not found: '. $name);
throw new \Exception('Initial state not found: ' . $name);
}
$base64 = $element->getAttribute('value');
$actual = base64_decode($base64);
$actual = $this->parseText($actual);
$expected = $this->parseText((string) $expected);
$expected = $this->parseText((string)$expected);
if ($this->isJson($expected)) {
Assert::assertJsonStringEqualsJsonString($expected, $actual);
} else {
Expand All @@ -527,7 +527,7 @@ public function theResponseShouldContainTheInitialStateJsonThatMatchWith(string
}
$element = $dom->getElementById('initial-state-' . $name);
if (!$element) {
throw new \Exception('Initial state not found: '. $name);
throw new \Exception('Initial state not found: ' . $name);
}
$base64 = $element->getAttribute('value');
$actual = base64_decode($base64);
Expand Down Expand Up @@ -564,7 +564,7 @@ private function parseTextRcursive(array &$array): array {
if (is_string($value)) {
$value = $this->parseText($value);
} elseif ($value instanceof \stdClass) {
$value = (array) $value;
$value = (array)$value;
$buffer = json_encode($this->parseTextRcursive($value));
Assert::assertIsString($buffer);
$value = json_decode($buffer);
Expand Down Expand Up @@ -657,7 +657,7 @@ private static function runBashCommand(string $command): array {

#[Given('the output of the last command should contain the following text:')]
public static function theOutputOfTheLastCommandContains(PyStringNode $text): void {
Assert::assertStringContainsString((string) $text, self::$commandOutput, 'The output of the last command does not contain: ' . (string) $text);
Assert::assertStringContainsString((string)$text, self::$commandOutput, 'The output of the last command does not contain: ' . (string)$text);
}

#[Given('the output of the last command should be empty')]
Expand Down
2 changes: 1 addition & 1 deletion vendor-bin/coding-standard/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"sort-packages": true
},
"require-dev": {
"nextcloud/coding-standard": "1.1.0"
"nextcloud/coding-standard": "^1.5"
}
}
Loading
Loading