Skip to content

Conversation

@X-Coder264
Copy link

We have this rule in our codebase (and other similar rules too):

    public function __invoke(): ArchRule
    {
        return Rule::allClasses()
            ->that(new RecursivelyExtend(EndToEndTestCase::class))
            ->andThat(new IsNotAbstract())
            ->should(new HaveNameMatching('*EndToEndTest'))
            ->because('all end-to-end tests must be named ending with EndToEndTest')
        ;
    }

Basically we want to make sure that all test class names in our testsuite that extend the base EndToEndTestCase class that are not abstract classes themselves must end with EndToEndTest.

After #454 this no longer works as the logic early returns in \Arkitect\Rules\Specs::allSpecsAreMatchedBy because \Arkitect\Expression\ForClasses\IsNotAbstract::appliesTo returns false for final classes (and all our test classes are final) and because of that the \Arkitect\Expression\ForClasses\HaveNameMatching expression never gets evaluated so no violations are reported.

After this fix appliesTo would return true and everything would continue to work as it did prior to that #454 PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant