-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance generator v6 locally to prevent a lot of warnings
- Loading branch information
Showing
46 changed files
with
5,386 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
Oops, something went wrong.