Code is Code

Whether it works or not.

How to add Mockery assertion counts to PHPUnit

by Etienne Marais in Testing

Have you ever seen this error message when running PHPUnit with Mockery assertions? This test did not perform any assertions It's rather confusing. It needn't be though. PHPUnit (specifically this version, 7.0.2) defaults it's Mark Test As Risky flag to true if it does not cont ...

How to check the timezone and update it

by Etienne Marais in Bash

When you spin up a new virtual machine on the cloud, you might be confused when you try run a cronjob at a certain time and it doesn't. You might want to back up some data or to rotate logs but it runs later than you expected. Check the timezone details on your ubuntu instance: ...

Pretend objects

by Etienne Marais in Testing

Pretend objects are things that provide the strategy for you to be able to write tests in an isolated way. Test Doubles is a generic term for any kind of pretend object used in place of the real object for testing purposes. This is a short and concise list of what these 4 pretend ...

How to post a file and form data using curl

by Etienne Marais in Bash

There will be times where you need to test an API file upload or just play around with sending data. curl supports this very well by making a Content-Type: multipart/form-data request along with you can send data and also the contents of a file. curl is used in command lines or ...

How to see what curl is sending without a server

by Etienne Marais in Bash

Being part of an awesome developer community is probably the one thing that keeps me learning more and more every day. I am thankful for being part of ZATech on Slack and I get to learn and see a great deal of cool things. nc Today I saw how to see what data gets sent via curl wi ...