thephpleague / factory-muffin

Enables the rapid creation of objects for testing
https://factory-muffin.thephpleague.com/
MIT License
531 stars 72 forks source link

FactoryMuffin loadDirectory filename regex does not seem to handle relative paths #419

Closed Bouwdie closed 4 years ago

Bouwdie commented 8 years ago

Maybe the regex could be simpler as well? [^\/]+\.php$ https://regex101.com/r/rJ3hS9/1

GrahamCampbell commented 8 years ago

Relative file path are intentionally not supported.

GrahamCampbell commented 8 years ago

What was your use case?

Bouwdie commented 8 years ago

The use case was loading a factories folder directly under /test/factories from a test class /test/Ns1/xTest.php. Now i called realpath on the relative dir to get it working. Or update the regex to handle relative paths. Why is it intentionally not supported? ../../factories i understand, but /home/test/foo/../factories should work right?

GrahamCampbell commented 8 years ago

Hmmm, ok. Feel free to submit a pull request, and I'll take a look at it. ;)

GrahamCampbell commented 8 years ago

Ping @Bouwdie. ;)

Bouwdie commented 8 years ago

Will take a look at it real soon @GrahamCampbell :100:

GrahamCampbell commented 4 years ago

Closing due to no response from the OP.