]> git.mxchange.org Git - friendica.git/commitdiff
fixing some more tests
authorMichael <heluecht@pirati.ca>
Sun, 16 Jan 2022 20:58:58 +0000 (20:58 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 16 Jan 2022 20:58:58 +0000 (20:58 +0000)
src/Module/Api/Friendica/Activity.php
src/Module/Api/Friendica/Notification.php
src/Module/Api/Friendica/Profile/Show.php
src/Module/Api/GNUSocial/Help/Test.php
src/Module/Api/Twitter/Account/RateLimitStatus.php
tests/src/Module/Api/GnuSocial/Help/TestTest.php

index 3915c2089e3a26952ca1faf58ee38f1a4f7b86db..3c892b3030e30628f1b100d27c0d75776e8524ca 100644 (file)
@@ -52,7 +52,7 @@ class Activity extends BaseApi
                $res = Item::performActivity($request['id'], $this->parameters['verb'], $uid);
 
                if ($res) {
-                       if ($this->parameters['extension'] ?? '' == 'xml') {
+                       if (($this->parameters['extension'] ?? '') == 'xml') {
                                $ok = 'true';
                        } else {
                                $ok = 'ok';
index d16e0e2b0d2ba0d7666486d9ec85463e7c2b6666..46320df153de0de88e77b360a9f3f7c2561de2a1 100644 (file)
@@ -43,7 +43,7 @@ class Notification extends BaseApi
                        $notifications[] = new ApiNotification($Notify);
                }
 
-               if ($this->parameters['extension'] ?? '' == 'xml') {
+               if (($this->parameters['extension'] ?? '') == 'xml') {
                        $xmlnotes = [];
                        foreach ($notifications as $notification) {
                                $xmlnotes[] = ['@attributes' => $notification->toArray()];
index 2507b7e275e62c64177bbb494d29ca8fc33175c4..2d686d9cae6940892d5332fbc7ae298eaf5a7938 100644 (file)
@@ -48,7 +48,7 @@ class Show extends BaseApi
                $profile = self::formatProfile($profile, $profileFields);
 
                $profiles = [];
-               if ($this->parameters['extension'] ?? '' == 'xml') {
+               if (($this->parameters['extension'] ?? '') == 'xml') {
                        $profiles['0:profile'] = $profile;
                } else {
                        $profiles[] = $profile;
index 44a31ba880b48a910cbc7dac116b00f8687c7728..ecf99c78bf383dfe34ab9a0997fcafaa0ed7ded8 100644 (file)
@@ -31,7 +31,7 @@ class Test extends BaseApi
 {
        protected function rawContent(array $request = [])
        {
-               if ($this->parameters['extension'] ?? '' == 'xml') {
+               if (($this->parameters['extension'] ?? '') == 'xml') {
                        $ok = 'true';
                } else {
                        $ok = 'ok';
index 60cee6ce347fc4346087cef89b34c7caddb6fd96..c5f052b39456b64950419caae58cb981bc5d1915 100644 (file)
@@ -31,7 +31,7 @@ class RateLimitStatus extends BaseApi
 {
        protected function rawContent(array $request = [])
        {
-               if ($this->parameters['extension'] ?? '' == 'xml') {
+               if (($this->parameters['extension'] ?? '') == 'xml') {
                        $hash = [
                                'remaining-hits'        => '150',
                                '@attributes'           => ["type" => "integer"],
index 28e7ab5ea3f439b044c6638a66afe4ecbac5d66c..be0e187a63ae2edee730284b0e7574b2073cd272 100644 (file)
@@ -51,6 +51,6 @@ class TestTest extends ApiTest
                        'Content-type'                => ['text/xml'],
                        ICanCreateResponses::X_HEADER => ['xml']
                ], $response->getHeaders());
-               self::assertxml($response->getBody(), 'true');
+               self::assertxml($response->getBody(), 'ok');
        }
 }