Skip to content

Commit

Permalink
Pest arch tests
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-boudry committed Sep 9, 2024
1 parent c83fb4e commit 8d3f11d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dev/CondorcetDocumentationGenerator/Generate.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,13 @@ public function __construct($path, public readonly string $pathBase)
if ($oneMethod->getNumberOfParameters() > 0) {
foreach ($oneMethod->getParameters() as $oneParameter) {
if (empty($oneParameter->getAttributes(FunctionParameter::class))) {
var_dump('Method Has Public API attribute but parameter $' . $oneParameter->getName() . ' is undocumented ' . $oneMethod->getDeclaringClass()->getName() . '->' . $oneMethod->getName());
var_dump('Method Has Public API attribute but parameter $' . $oneParameter->getName() . ' is undocumented ' . $oneMethod->getDeclaringClass()->getName() . '->' . $oneMethod->getName()); // @pest-arch-ignore-line
}
}
}

if (empty($oneMethod->getAttributes(Description::class)) && $oneMethod->getDeclaringClass()->getNamespaceName() !== '') {
var_dump('Description Attribute is empty: ' . $oneMethod->getDeclaringClass()->getName() . '->' . $oneMethod->getName());
var_dump('Description Attribute is empty: ' . $oneMethod->getDeclaringClass()->getName() . '->' . $oneMethod->getName()); // @pest-arch-ignore-line
}
} else {
$non_inDoc++;
Expand Down
11 changes: 11 additions & 0 deletions tests/Arch/archTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

namespace Tests;

use CondorcetPHP\Condorcet\Dev\CondorcetDocumentationGenerator\Generate;

arch()->preset()->php()->ignoring(Generate::class);
arch()->preset()->security();
// arch()->preset()->strict()->ignoring('to be final');

0 comments on commit 8d3f11d

Please sign in to comment.