Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recent change for callables in model factories attributes breaks existing factories #20718

Closed
Crinsane opened this issue Aug 24, 2017 · 2 comments

Comments

@Crinsane
Copy link
Contributor

  • Laravel Version: 5.4.34
  • PHP Version: 7.0.8
  • Database Driver & Version: SQL server

Description:

The recent change to add support for callables in model factories attributes broke our testsuite. #20692
I filtered the problem down to the change made in this commit 91765f5 where it checks if the attribute you give the factory is a callable.
In one of our factories, a possible value of an attribute is DIR, and it PHP will tell you this is callable (the dir() global function). So it will try to call dir() and pass it the attributes array, which will result in an exception: dir() expects parameter 1 to be a valid path, array given

Steps To Reproduce:

  1. Create a model factory
  2. Set one of the attributes to some global function name
  3. Try to use the factory and see it fail
@themsaid
Copy link
Member

fixed

@Crinsane
Copy link
Contributor Author

Thanks a lot!

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

No branches or pull requests

2 participants