Skip to content

Conversation

@dereuromark
Copy link
Member

@dereuromark dereuromark commented Nov 13, 2025

Resolves #1040

Usage:

  # For a class without required constructor args
  bin/cake bake test Class 'Service\SimpleCalculator'

  # For a class with required constructor args  
  bin/cake bake test Class 'Service\UserService'

Generated Output:

Without required constructor args:

  • Generates test subject property
  • Generates setUp() and tearDown() methods
  • Generates test method stubs for all public methods

With required constructor args:

  • Skips test subject property
  • Skips setUp() and tearDown() methods
  • Generates test method stubs with markTestIncomplete()

@dereuromark dereuromark added this to the 3.x (CakePHP 5) milestone Nov 13, 2025
@dereuromark dereuromark marked this pull request as draft November 13, 2025 05:35
@dereuromark dereuromark marked this pull request as ready for review November 13, 2025 05:49
@markstory markstory merged commit 3e8ca4b into 3.x Nov 14, 2025
7 of 9 checks passed
@markstory markstory deleted the bake-classes branch November 14, 2025 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow baking any test class

3 participants