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

Model TestCase fixtures #427

Closed
LubosRemplik opened this issue Mar 1, 2018 · 4 comments
Closed

Model TestCase fixtures #427

LubosRemplik opened this issue Mar 1, 2018 · 4 comments
Milestone

Comments

@LubosRemplik
Copy link

When you bake Model Table Test, it bakes $fixtures property with all possible fixtures depending on associations. Sometimes there are too many and I think by default it could bake just fixture for the table itself, for example for PostsTableTest it would bake

public $fixtures = [
    'app.posts'
];

I am thinking about this because once I bake something, I have to remove fixtures otherwise phpunit test fails

What do you think?

@dereuromark
Copy link
Member

Let's compromise: At least only the own model and direct relations.
All fixtures are really too much, I agree. Always have to delete 80+ of the 84 etc.

@LubosRemplik
Copy link
Author

LubosRemplik commented Mar 1, 2018

So I would just delete lines from https://github.com/cakephp/bake/blob/master/src/Shell/Task/TestTask.php#L446 to the end of the method, but I think you would just not call the _processModel recursively while keeping direct associations?

@markstory markstory added this to the 1.7.x milestone Mar 1, 2018
@markstory
Copy link
Member

Let's compromise: At least only the own model and direct relations.

👍 to this if we're going to make a change.

@dereuromark
Copy link
Member

@LubosRemplik Give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants