[SOLVED] Problems marking Test directory as such

Already since some time I can't mark the `Test/` directory as such. This "broke" a few versions ago but never managed to look into it:

In the past "past" this worked and I could manually set it.

 

This project is special and contains three (1) `composer.json` files:

  • on in the root /
  • one in app/ (can be seen above)
  • another in otherproject/ (not seen above)

I think at some point I played around with composer synchronization but not sure.

The app/composer.json has this autoload configs

```
"autoload": {
"psr-4": {
"Project\\": "Lib/"
}
},
"autoload-dev": {
"psr-4": {
"Project\\Test\\": "Test/"
}
},
```

 

Interesting fact: I can select directories outside of app/ to be marked for tests, but not within.

app is marked as sources root

 

thanks,

- markus

3 comments
Comment actions Permalink

Hi there,

First try disabling composer sync: "Settings (Preferences on macOS) | Languages & Frameworks | PHP | Composer | Synchronize IDE Settings with composer.json"

See if you can mark then as Test Source in "Settings (Preferences on macOS) | Directories" (same as via context menu, just the actual place).

 

P.S. I believe it's because your parent folder (app) is marked as Source folder already... so all sub folders are now of Source kind.

Proper project layout would be to have "src" ("app" in your case) and "tests" folders next to each other (the same level) and not one as a child of another (e.g. look at typical Laravel app or popular libraries, e.g. Doctrine [1] and [2]). So if you can, consider moving that folder to the same level as "app".

1
Comment actions Permalink

The "Directories" setting was an eye opener!

I could there select the "Tests" directory and mark it as such. Let's see if that works out, thank you for now!

- Markus

0
Comment actions Permalink

Still works today, thank you!

0

Please sign in to leave a comment.