Skip to content

u/Colonel-Rosa

In this archive from Nov 2009 to Feb 2018

26
posts
352
comments
3
media
1.8k
score

It's mainly dependencies of dependencies.

For example. If a method takes the Symfony request object and I use $request->query inside. I now need to mock, not just the Request, but also the parameter bag (or at least construct it). Same goes for repository methods with Doctrine. I know it feels wrong to test that sort of stuff at a unit level, but it's sometime useful to see if it's constructing the correct query without executing it. Doing that is even worse as you go down a giant rabbit hole.

3 points

How are people writing clean unit tests?

When I'm writing unit tests, I use Mockery for mocking my dependencies, but I find all too often that my test methods are 100 lines of Mockery and the assertion is lost at the bottom. Is this just a symptom of my methods doing too much or is there something I'm missing?

Help appreciated.

4 points

So I was looking into why this happens because the article boils down to "This is faster" and doesn't explain what is really happening and how it could negatively affect your work.

The flag is used in the GitHub driver and initialises a Git driver if the flag is true.

This means when the GitHub driver is looking up branches, etc ... it uses the local copy only as seen here and doesn't send an API call to GitHub. This means it no longer has to download and parse JSON files (faster). The downsides is that your metadata might not be up to date (I think) as someone could have pushed a new branch to GH and your composer wouldn't know about it.

8 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.