2

I am trying to autoload the contents of src folder and use them in some unit tests . Here is the autoloading part of composer.json

"autoload": {
    "psr-0": {
      "Meetup\\Login\\": "src/"
    }
}

There is a class called users in src/core folder. Screenshot attached.

Any idea why i get the error PHP Fatal error: Class 'Meetup\Login\Core\Users in a unit test which tries to import the users class using use Meetup\Login\Core\Users

enter image description here Note: Most probably a stupid oversight from my part.

Swaraj Giri
  • 4,007
  • 2
  • 27
  • 44

1 Answers1

1

As pointed out by @Orangepill and @Havelock, i indeed have a problem with my eyes.

It should be psr-4 instead of psr-0 and users.php needs to be renamed as Users.php.

Swaraj Giri
  • 4,007
  • 2
  • 27
  • 44