]> git.mxchange.org Git - friendica.git/blobdiff - tests/src/Module/Api/ApiTest.php
Fixing tests again
[friendica.git] / tests / src / Module / Api / ApiTest.php
index 23a109e6f8162cac29612dab67c0d9fb836fcdff..e168c26555d774bd93bf30db75543daa056f30f9 100644 (file)
@@ -31,8 +31,23 @@ use Friendica\Test\FixtureTest;
 use Friendica\Test\Util\ApiResponseDouble;
 use Friendica\Test\Util\AuthenticationDouble;
 
-class ApiTest extends FixtureTest
+abstract class ApiTest extends FixtureTest
 {
+       /**
+        * Assert that the string is XML and contain the root element.
+        *
+        * @param string $result       XML string
+        * @param string $root_element Root element name
+        *
+        * @return void
+        */
+       protected function assertXml(string $result = '', string $root_element = '')
+       {
+               self::assertStringStartsWith('<?xml version="1.0"?>', $result);
+               self::assertStringContainsString('<' . $root_element, $result);
+               // We could probably do more checks here.
+       }
+
        protected function setUp(): void
        {
                parent::setUp(); // TODO: Change the autogenerated stub