Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

TJ Miller:
Separate Interactive Test Suites
Mar 26, 2018 @ 17:56:24

In a post to his Medium.com site TJ Miller has a quick post for the PHPUnit users out there showing how to isolate your tests and prevent them from interacting by splitting them into different test suites.

On a recent Full Stack Radio episode Adam Wathan and Taylor Otwell were talking about testing Laravel applications. During the episode, they spoke about isolating interactive integration tests from your normal testing e.g. payment gateways, third-party integrations.

TJ shares an example of a project he's working on where this is useful: avoiding interactions with an HTTP API every time the tests run. He then shows how, with a single PHPUnit configuration, you can split up the tests by name and directory to prevent them all from executing every time. Then the "testsuite" option can be used to isolate the execution from the command-line. An example of the XML configuration is also included in the post.

tagged: tutorial phpunit separate test suite isolation configuration

Link: https://medium.com/@sixlive/separate-interactive-test-suites-f6fd59316ec2

Freek Lijten:
Separating models and logic for storing and loading
Feb 16, 2015 @ 16:53:43

In a recent post Freek Lijten shares a simplified version of a solution he came up with to separate models and their logic between the fetch and save operations.

Basically I am wondering how storing data and retrieving data are different and how you should / could model this. Since we need different information while storing and retrieving information it makes sense to model those actions in different ways. The how is still bothering me and in this post I give a possible solution. I truly hope I can get some reactions and thoughts of other people in on how they would solve these kind of problems.

He introduces the basic structure of the application he's working with and how the concept of "documents" ties in. Then he gets into the problem: the differences in data required for the save versus locate and load. His solution is to split out the different pieces (relations) of the document into separate value objects. These objects then only contain the handling to get only the relations needed on the load. He doesn't like the solution, however, because of the amount of overhead it introduces.

tagged: separate model load locate save operation object

Link: http://www.freeklijten.nl/home/2015/02/13/Separating-models-and-logic-for-storing-and-loading

Ryan Malesevich's Blog:
Separate Trackbacks from Comments Revisited
Feb 02, 2007 @ 15:05:00

Ryan Malesevich has posted a new entry that might be of interest you all of you WordPress-ers out there. In it he talks about a plugin you can use to separate out the comments from the trackbacks in the listing for a post.

I was lucky enough to come across a blog post on Binary Moon that included a function that would allow you to break up the trackbacks and the comments in your template. [...] The problem with that is everytime Wordpress upgrades I overwrite functions.php and then comments no longer work.

To get around it, he used WordPress' own plugin system to make the separation via this simple plugin [zip]. It's a simple install, but a bit of functionality that can really help out if you get a lot of both trackbacks and comments.

tagged: wordpress trackback comment separate plugin wordpress trackback comment separate plugin

Link:

Ryan Malesevich's Blog:
Separate Trackbacks from Comments Revisited
Feb 02, 2007 @ 15:05:00

Ryan Malesevich has posted a new entry that might be of interest you all of you WordPress-ers out there. In it he talks about a plugin you can use to separate out the comments from the trackbacks in the listing for a post.

I was lucky enough to come across a blog post on Binary Moon that included a function that would allow you to break up the trackbacks and the comments in your template. [...] The problem with that is everytime Wordpress upgrades I overwrite functions.php and then comments no longer work.

To get around it, he used WordPress' own plugin system to make the separation via this simple plugin [zip]. It's a simple install, but a bit of functionality that can really help out if you get a lot of both trackbacks and comments.

tagged: wordpress trackback comment separate plugin wordpress trackback comment separate plugin

Link:


Trending Topics: