Skip to content

2.x refactor tests#2085

Merged
gchtr merged 16 commits into2.x-apifrom
2.x-refactor-tests
Jan 6, 2020
Merged

2.x refactor tests#2085
gchtr merged 16 commits into2.x-apifrom
2.x-refactor-tests

Conversation

@acobster
Copy link
Copy Markdown
Collaborator

@acobster acobster commented Oct 1, 2019

Ticket: #1793

Issue

We're moving to a new API that will restrict direct instantiation of core Timber objects (Post, User, Menu, etc.) in favor of corresponding Timber::get_* calls.

Solution

This refactors away most direct instantiations within the tests. Some refactors we'll need to do eventually are impossible right now, since the Timber class lacks some get_* methods we'll need to replace the calls with. I don't want to add any code just yet, so I'm just taking care of the low hanging fruit right now.

Impact

None.

Usage Changes

No changes to production code in this PR; only tests.

Considerations

???

Testing

You know I'm all about those tests tho.

Coby Tamayo added 4 commits September 30, 2019 15:35
This replaces *most* instances of `new Timber\Post(...)` with
calls to `Timber::get_post()`, which in the future will be the only
way to instantiated Timber objects. The `Timber\Post` constructor
will be made protected.
@acobster acobster requested a review from gchtr October 1, 2019 00:08
Copy link
Copy Markdown
Member

@gchtr gchtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! It’s great to see you jumping into this. 😎

Coby Tamayo added 4 commits October 1, 2019 10:53
These were intended to test direct instantiation of Terms, which is going away.
@acobster
Copy link
Copy Markdown
Collaborator Author

acobster commented Oct 2, 2019

@gchtr any more feedback before I merge this in?

@acobster acobster force-pushed the 2.x-refactor-tests branch from dd50043 to 76a5427 Compare October 3, 2019 05:18
@gchtr gchtr closed this Oct 6, 2019
@jarednova
Copy link
Copy Markdown
Member

@gchtr are you sure you meant to close this issue?

@gchtr
Copy link
Copy Markdown
Member

gchtr commented Oct 7, 2019

Nope, I didn’t. For the documentation in #2073, I first created a 2.x-api branch, that I then renamed to 2.x-docs-api. I saw yesterday that the 2.x-api branch still existed and assumed we didn’t use it, so I deleted it. Except this pull request is made against the 2.x-api branch, so we still need it 🙈. It’s back now 😅. Sorry!

@gchtr gchtr reopened this Oct 7, 2019
@jarednova jarednova requested a review from gchtr January 6, 2020 00:37
@gchtr gchtr merged commit cf50f52 into 2.x-api Jan 6, 2020
@gchtr gchtr deleted the 2.x-refactor-tests branch January 6, 2020 20:55
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

Successfully merging this pull request may close these issues.

3 participants