Skip to content

Commit

Permalink
covers attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkaOnLine committed Aug 9, 2024
1 parent 6c6b546 commit 556f1a2
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 4 deletions.
6 changes: 2 additions & 4 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
forceCoversAnnotation="true"
beStrictAboutCoversAnnotation="true"
requireCoverageMetadata="true"
beStrictAboutCoverageMetadata="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
convertDeprecationsToExceptions="true"
stopOnFailure="false"
cacheDirectory=".phpunit.cache"
>
Expand Down
3 changes: 3 additions & 0 deletions tests/ConfigFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@

namespace Tests;

use L5Swagger\ConfigFactory;
use L5Swagger\Exceptions\L5SwaggerException;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\TestDox;

/**
* @covers \L5Swagger\ConfigFactory
*/
#[TestDox('Configuration factory')]
#[CoversClass(ConfigFactory::class)]
class ConfigFactoryTest extends TestCase
{
public function testItThrowsExceptionIfDocumentationConfigNotFound(): void
Expand Down
3 changes: 3 additions & 0 deletions tests/ConsoleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
use Illuminate\Contracts\Filesystem\FileNotFoundException;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Facades\Artisan;
use L5Swagger\Console\GenerateDocsCommand;
use L5Swagger\Exceptions\L5SwaggerException;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\TestDox;

/**
* @covers \L5Swagger\Console\GenerateDocsCommand
*/
#[TestDox('Console commands')]
#[CoversClass(GenerateDocsCommand::class)]
class ConsoleTest extends TestCase
{
/**
Expand Down
3 changes: 3 additions & 0 deletions tests/GeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

use Illuminate\Http\Request;
use L5Swagger\Exceptions\L5SwaggerException;
use L5Swagger\Generator;
use OpenApi\Analysers\TokenAnalyser;
use OpenApi\Processors\CleanUnmerged;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\TestDox;
use Symfony\Component\Yaml\Parser;
use Symfony\Component\Yaml\Yaml;
Expand All @@ -14,6 +16,7 @@
* @covers \L5Swagger\Generator
*/
#[TestDox('Generator')]
#[CoversClass(Generator::class)]
class GeneratorTest extends TestCase
{
/**
Expand Down
3 changes: 3 additions & 0 deletions tests/HelpersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
namespace Tests;

use L5Swagger\Exceptions\L5SwaggerException;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\CoversFunction;
use PHPUnit\Framework\Attributes\TestDox;

/**
* @covers L5SwaggerException
*/
#[TestDox('Helpers')]
#[CoversFunction('l5_swagger_asset')]
class HelpersTest extends TestCase
{
public function testAssetFunctionThrowsExceptionIfFileDoesNotExists(): void
Expand Down
5 changes: 5 additions & 0 deletions tests/RoutesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
use L5Swagger\Exceptions\L5SwaggerException;
use L5Swagger\Generator;
use L5Swagger\GeneratorFactory;
use L5Swagger\Http\Controllers\SwaggerAssetController;
use L5Swagger\Http\Controllers\SwaggerController;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\Framework\MockObject\Exception;

Expand All @@ -13,6 +16,8 @@
* @covers \L5Swagger\Http\Controllers\SwaggerAssetController
*/
#[TestDox('Routes')]
#[CoversClass(SwaggerController::class)]
#[CoversClass(SwaggerAssetController::class)]
class RoutesTest extends TestCase
{
public function testUserCantAccessJsonFileIfItIsNotGenerated(): void
Expand Down
3 changes: 3 additions & 0 deletions tests/SecurityDefinitionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@

use Illuminate\Filesystem\Filesystem;
use L5Swagger\Exceptions\L5SwaggerException;
use L5Swagger\SecurityDefinitions;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\TestDox;

/**
* @covers \L5Swagger\SecurityDefinitions
*/
#[TestDox('Security definition')]
#[CoversClass(SecurityDefinitions::class)]
class SecurityDefinitionsTest extends TestCase
{
/**
Expand Down

0 comments on commit 556f1a2

Please sign in to comment.