Skip to content

Commit

Permalink
Fix public method name architecture test
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosas committed Feb 14, 2025
1 parent 7a10ecd commit 243d8b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
11 changes: 0 additions & 11 deletions tests/architecture/AssertionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

namespace Tests\PHPat\architecture;

use PHPat\Parser\TypeNodeParser;
use PHPat\Rule\Assertion\Assertion;
use PHPat\Rule\Assertion\Declaration\DeclarationAssertion;
use PHPat\Rule\Assertion\Relation\RelationAssertion;
use PHPat\Selector\Selector;
use PHPat\Test\Builder\Rule;
use PHPat\Test\PHPat;
Expand All @@ -29,14 +26,6 @@ public function test_rules_are_not_abstract(): Rule
;
}

public function test_rules_public_method_named(): Rule
{
return PHPat::rule()
->classes(Selector::classname('/.*\\\Extractor\\\.*Extractor/', true))
->shouldHaveOnlyOnePublicMethodNamed('getNodeType')
;
}

/*public function test_rules_dependencies(): Rule
{
return PHPat::rule()
Expand Down
9 changes: 9 additions & 0 deletions tests/architecture/CleanClassesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use PHPat\Selector\Selector;
use PHPat\Selector\SelectorPrimitive;
use PHPat\Statement\Builder\StatementBuilder;
use PHPat\Test\Builder\AbstractStep;
use PHPat\Test\Builder\Rule;
use PHPat\Test\PHPat;
Expand All @@ -28,4 +29,12 @@ public function test_non_abstract_classes_are_final(): Rule
->shouldBeFinal()
;
}

public function test_builders_only_public_method_build(): Rule
{
return PHPat::rule()
->classes(Selector::implements(StatementBuilder::class))
->shouldHaveOnlyOnePublicMethodNamed('build')
;
}
}

0 comments on commit 243d8b5

Please sign in to comment.