Skip to content

Commit

Permalink
Enhance generator v6 locally to prevent a lot of warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dmetzner committed Jun 3, 2022
1 parent 59ed153 commit 129a55b
Show file tree
Hide file tree
Showing 46 changed files with 5,386 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,50 @@ Service/StrictJsonDeserializationVisitorFactory.php
Service/SymfonyValidator.php
Service/TypeMismatchException.php
Service/ValidatorInterface.php
Tests/Api/AuthenticationApiInterfaceTest.php
Tests/Api/MediaLibraryApiInterfaceTest.php
Tests/Api/NotificationsApiInterfaceTest.php
Tests/Api/ProjectsApiInterfaceTest.php
Tests/Api/SearchApiInterfaceTest.php
Tests/Api/UserApiInterfaceTest.php
Tests/Api/UtilityApiInterfaceTest.php
Tests/AppKernel.php
Tests/Controller/ControllerTest.php
Tests/Model/BaseUserTest.php
Tests/Model/BasicUserDataResponseTest.php
Tests/Model/DryRunTest.php
Tests/Model/ExtendedUserDataResponseAllOfTest.php
Tests/Model/ExtendedUserDataResponseTest.php
Tests/Model/ExtensionResponseTest.php
Tests/Model/FeaturedProjectResponseTest.php
Tests/Model/JWTResponseTest.php
Tests/Model/LoginRequestTest.php
Tests/Model/MediaCategoryResponseTest.php
Tests/Model/MediaFileResponseTest.php
Tests/Model/MediaPackageResponseTest.php
Tests/Model/NotificationContentTest.php
Tests/Model/NotificationResponseTest.php
Tests/Model/NotificationsCountResponseTest.php
Tests/Model/OAuthLoginRequestTest.php
Tests/Model/ProjectReportRequestTest.php
Tests/Model/ProjectResponseTest.php
Tests/Model/ProjectsCategoryTest.php
Tests/Model/RefreshRequestTest.php
Tests/Model/RegisterErrorResponseTest.php
Tests/Model/RegisterRequestTest.php
Tests/Model/ResetPasswordErrorResponseTest.php
Tests/Model/ResetPasswordRequestTest.php
Tests/Model/SearchResponseTest.php
Tests/Model/SurveyResponseTest.php
Tests/Model/TagResponseTest.php
Tests/Model/UpdateProjectErrorResponseTest.php
Tests/Model/UpdateProjectFailureResponseTest.php
Tests/Model/UpdateProjectRequestTest.php
Tests/Model/UpdateUserErrorResponseTest.php
Tests/Model/UpdateUserRequestAllOfTest.php
Tests/Model/UpdateUserRequestTest.php
Tests/Model/UpgradeTokenRequestTest.php
Tests/Model/UploadErrorResponseTest.php
Tests/test_config.yml
autoload.php
git_push.sh
Expand Down
178 changes: 178 additions & 0 deletions Tests/Api/AuthenticationApiInterfaceTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
<?php
/**
* AuthenticationApiInterfaceTest
* PHP version 8.1.1.
*
* @category Class
*
* @author openapi-generator contributors
*
* @see https://github.com/openapitools/openapi-generator
*/

/**
* Catroweb API.
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.2
* Contact: [email protected]
* Generated by: https://github.com/openapitools/openapi-generator.git
*/

/**
* NOTE: This class is auto generated by the openapi generator program.
* https://github.com/openapitools/openapi-generator
* Please update the test case below to test the endpoint.
*/

namespace OpenAPI\Server\Tests\Api;

use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

/**
* AuthenticationApiInterfaceTest Class Doc Comment.
*
* @category Class
*
* @author openapi-generator contributors
*
* @see https://github.com/openapitools/openapi-generator
*
* @internal
* @coversNothing
*/
class AuthenticationApiInterfaceTest extends WebTestCase
{
private static ?KernelBrowser $client = null;

/**
* Setup before running any test cases.
*/
public static function setUpBeforeClass(): void
{
}

/**
* Setup before running each test case.
*/
public function setUp(): void
{
if (null === self::$client) {
self::$client = static::createClient();
}
}

/**
* Clean up after running each test case.
*/
public function tearDown(): void
{
static::ensureKernelShutdown();
}

/**
* Clean up after running all test cases.
*/
public static function tearDownAfterClass(): void
{
}

/**
* Test case for authenticationDelete.
*
* Expires refresh token.
*/
public function testAuthenticationDelete(): void
{
$client = self::$client;

$path = '/authentication';

$crawler = $client->request('DELETE', $path);
}

/**
* Test case for authenticationGet.
*
* Check token.
*/
public function testAuthenticationGet(): void
{
$client = self::$client;

$path = '/authentication';

$crawler = $client->request('GET', $path);
}

/**
* Test case for authenticationOauthPost.
*
* OAuth Login.
*/
public function testAuthenticationOauthPost(): void
{
$client = self::$client;

$path = '/authentication/oauth';

$crawler = $client->request('POST', $path, [], [], ['CONTENT_TYPE' => 'application/json']);
}

/**
* Test case for authenticationPost.
*
* Login.
*/
public function testAuthenticationPost(): void
{
$client = self::$client;

$path = '/authentication';

$crawler = $client->request('POST', $path, [], [], ['CONTENT_TYPE' => 'application/json']);
}

/**
* Test case for authenticationRefreshPost.
*
* Refresh token.
*/
public function testAuthenticationRefreshPost(): void
{
$client = self::$client;

$path = '/authentication/refresh';

$crawler = $client->request('POST', $path, [], [], ['CONTENT_TYPE' => 'application/json']);
}

/**
* Test case for authenticationUpgradePost.
*
* Upgrade a deprecated token to JWT.
*/
public function testAuthenticationUpgradePost(): void
{
$client = self::$client;

$path = '/authentication/upgrade';

$crawler = $client->request('POST', $path, [], [], ['CONTENT_TYPE' => 'application/json']);
}

/**
* @return mixed
*/
protected function genTestData(string $regexp)
{
$grammar = new \Hoa\File\Read('hoa://Library/Regex/Grammar.pp');
$compiler = \Hoa\Compiler\Llk\Llk::load($grammar);
$ast = $compiler->parse($regexp);
$generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random());

return $generator->visit($ast);
}
}
156 changes: 156 additions & 0 deletions Tests/Api/MediaLibraryApiInterfaceTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
<?php
/**
* MediaLibraryApiInterfaceTest
* PHP version 8.1.1.
*
* @category Class
*
* @author openapi-generator contributors
*
* @see https://github.com/openapitools/openapi-generator
*/

/**
* Catroweb API.
*
* API for the Catrobat Share Platform
*
* The version of the OpenAPI document: v1.1.2
* Contact: [email protected]
* Generated by: https://github.com/openapitools/openapi-generator.git
*/

/**
* NOTE: This class is auto generated by the openapi generator program.
* https://github.com/openapitools/openapi-generator
* Please update the test case below to test the endpoint.
*/

namespace OpenAPI\Server\Tests\Api;

use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

/**
* MediaLibraryApiInterfaceTest Class Doc Comment.
*
* @category Class
*
* @author openapi-generator contributors
*
* @see https://github.com/openapitools/openapi-generator
*
* @internal
* @coversNothing
*/
class MediaLibraryApiInterfaceTest extends WebTestCase
{
private static ?KernelBrowser $client = null;

/**
* Setup before running any test cases.
*/
public static function setUpBeforeClass(): void
{
}

/**
* Setup before running each test case.
*/
public function setUp(): void
{
if (null === self::$client) {
self::$client = static::createClient();
}
}

/**
* Clean up after running each test case.
*/
public function tearDown(): void
{
static::ensureKernelShutdown();
}

/**
* Clean up after running all test cases.
*/
public static function tearDownAfterClass(): void
{
}

/**
* Test case for mediaFileIdGet.
*
* Get the information of a specific media file.
*/
public function testMediaFileIdGet(): void
{
$client = self::$client;

$path = '/media/file/{id}';
$pattern = '{id}';
$data = $this->genTestData('\d+');
$path = str_replace($pattern, $data, $path);

$crawler = $client->request('GET', $path);
}

/**
* Test case for mediaFilesGet.
*
* Get *all* content of the media library..
*/
public function testMediaFilesGet(): void
{
$client = self::$client;

$path = '/media/files';

$crawler = $client->request('GET', $path);
}

/**
* Test case for mediaFilesSearchGet.
*
* Search for mediafiles associated with keywords.
*/
public function testMediaFilesSearchGet(): void
{
$client = self::$client;

$path = '/media/files/search';

$crawler = $client->request('GET', $path);
}

/**
* Test case for mediaPackageNameGet.
*
* Get media-library asstes of a named package.
*/
public function testMediaPackageNameGet(): void
{
$client = self::$client;

$path = '/media/package/{name}';
$pattern = '{name}';
$data = $this->genTestData('^[a-zA-Z0-9\\-_]+$');
$path = str_replace($pattern, $data, $path);

$crawler = $client->request('GET', $path);
}

/**
* @return mixed
*/
protected function genTestData(string $regexp)
{
$grammar = new \Hoa\File\Read('hoa://Library/Regex/Grammar.pp');
$compiler = \Hoa\Compiler\Llk\Llk::load($grammar);
$ast = $compiler->parse($regexp);
$generator = new \Hoa\Regex\Visitor\Isotropic(new \Hoa\Math\Sampler\Random());

return $generator->visit($ast);
}
}
Loading

0 comments on commit 129a55b

Please sign in to comment.