Etienne Marais

Etienne Marais

How to add Mockery assertion counts to PHPUnit

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 run a public docker container with a private OAuth token

in Docker

Dockerhub makes it incredibly easy to host docker builds for re-use. You can setup your ideal world software environment in a container and ship that anywhere really. In this instance I needed to run unit tests against a PHP 5.6 composer project. I wanted to run the tests in a wa ...

How to check the timezone and update it

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

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

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

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 ...