Codeception: phpstan can't find support/helper classes

What are you trying to achieve?

phpstan to autoload my tests/_support classes

What do you get instead?

phpstan saying class not found

Provide console output if related. Use -vvv mode for more details.

Provide test source code if related

backend/tests/_support/ApiTester.php
class ApiTester extends \Codeception\Actor

tests/ap/MyFileCest.php

public function testStore(ApiTester $I) 
{
        $I->sendPOST(route('invoice_line.store')
}

Details

codeception.yml

paths:
    tests: tests
    output: tests/_output
    data: tests/_data
    support: tests/_support
    envs: tests/_envs
actor_suffix: Tester
extensions:
    enabled:
        - Codeception\Extension\RunFailed

api.suite.yml

actor: ApiTester
modules:
    enabled:
        - Helper\Api
        - Helper\MaintainableEntity
        - Asserts
        - REST:
            url: /api/
            depends: Laravel5
        - Laravel5:
            environment_file: .env.testing
            run_database_migrations: false
            cleanup: false
extensions:
  enabled:
    - Codeception\Extension\RunFailed
    - DbResetter
    - ApiHeaderSetter

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (1 by maintainers)

Most upvoted comments

@ondrejmirtes of course we all know there is a guide, and we can read it. The point is how to resolve the issue sent by @dragoonis. We need some lines of code or an example.