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

Free the Geek:
Episode 16 - Talking Testing and Building YOUR Dream with Chris Hartjes
Apr 20, 2016 @ 09:13:51

The Free the Geek podcast, hosted by Matthew Setter, has posted their latest episode (#16), a chat with Chris Hartjes about testing and "building your dream" based on some of his own experiences.

In this episode I chat with Chris Hartjes, the Grumpy Programmer himself, about the ins and outs of testing and what it’s like to spend part of your working week building your dreams, instead of someone else’s.

Amongst the talk on testing, we cover a range of interesting points, such as monkey patching, mutation testing, and how TDD is more a design process than anything else. When it comes to building your dream, Chris shares some personal insights in to what prompted him to build grumpy learning, and who some of his greatest mentors have been.

You can listen to this latest episode either through the in-page audio player or by downloading the mp3 of the show for listening at your leisure. If you enjoy the show be sure to subscribe to their feed and follow them on Twitter for more updates when new shows are released.

tagged: freethegeekpodcast ep16 chrishartjes testing dream community interview

Link: http://freethegeek.fm/episode/episode-0016

Adam Culp:
Setting up step debugging in Zend Studio
Apr 11, 2016 @ 11:52:43

Adam Culp has posted a guide on his site showing you how to set up debugging in Zend Studio, the PHP IDE from Zend. In it he walks you through the setup on both the server and client side to get them working happily together.

Recently I was helping someone set up step debugging in Zend Studio, and had some difficulties. Therefore I decided to create a blog post to remind me later, and perhaps help others get it set up.

I was doing this on an Ubuntu laptop, so while menus may vary slightly the process should be very similar. Also, I did this using a local virtual machine in VirtualBox, but using Bridged networking mode to simulate a remote server. In Zend Studio I had a project created with the Zend Framework Skeleton Application, and created a virtualhost in the virtual environment that mirrored that.

He starts with the server, pointing out that the only thing really needed there is an installed and working version of Xdebug. He then goes through each step in the IDE, complete with screenshots:

  • Configuring the server in the Preferences
  • Testing the connection between the two
  • Enabling debugging on the project
  • Ensuring the server is configured correctly to use debugging when specified

While some of his instructions are more specific to a Zend Server installation, they can still be mostly applied to any kind of system. You can also check the Xdebug documentation for additional help.

tagged: debugging zendstudio guide zendserver configuration testing xdebug

Link: http://www.geekyboy.com/archives/1220

SitePoint PHP Blog:
Crash Course into Continuous Testing with Sismo
Mar 29, 2016 @ 12:03:54

On the SitePoint PHP blog there's a tutorial posted helping you get started with Sismo, a simple component that can help you with the continuous testing of your PHP applications. Sismo is a project from SensioLabs, the same group behind Symfony and Twig (and several other popular tools).

The PHP community started to adopt the testing culture relatively recently. Despite there being some debates on how to achieve this, nobody can argue the importance of having your code fully covered by tests. In this article, we’re going to explore a tool that will help you in a major part of the testing culture called continuous testing.

Sismo is a small component which you can easily integrate with your projects to make the process of continuous testing easier. Sismo's main focus is to run your tests and send you status notifications.

They help you get the tool installed (either from GitHub or directly) and configure your project with a simple PHP file. They also include instructions on how to execute the tests for the project and an example of the resulting output. The tutorial then shows how to set up a project using the remote repository handling, setting up notifiers for failures, storing the build information and using it in a git hook.

tagged: continuous testing sismo sensiolabs tutorial setup configuration phpunit test

Link: http://www.sitepoint.com/continuous-testing-with-sismo/

Jeff Geerling:
Yes, Drupal 8 is slower than Drupal 7 - here's why
Mar 25, 2016 @ 12:05:44

Jeff Geerling has an interesting post to his site showing the results of some of his own testing around the performance of Drupal 8 versus Drupal 7...and that 8 comes out to be slower than 7. He also includes some of the things that the Drupal project is doing to help the situation.

When some people see reports of Drupal 8 being 'dramatically' slower than Drupal 7, they wonder why, and they also use this performance change as ammunition against some of the major architectural changes that were made during Drupal 8's development cycle.

First, I wanted to give some more concrete data behind why Drupal 8 is slower (specifically, what kinds of things does Drupal 8 do that make it take longer per request than Drupal 7 on an otherwise-identical system), and also why this might or might not make any difference in your choice to upgrade to Drupal 8 sooner rather than later.

He shares the results of some of his own benchmarking on a cluster (bramble) of Raspberry Pis for the requests per second on the standard setup for each version. He includes the output from an XHProf profiling run too, showing the large call stack on both sides, not just Drupal 8. He then talks about some of the Drupal 8 updates that are included to help mitigate some of these issues: architecture changes, easier caching, authenticated user handing and slow loading content management.

tagged: drupal8 drupal7 performance raspberrypi cluster testing results benchmark

Link: http://www.jeffgeerling.com/blog/2016/yes-drupal-8-slower-drupal-7-heres-why

Marcel Pociot:
Laravel TestTools (Chrome Extension)
Mar 22, 2016 @ 10:48:10

Marcel Pociot has a new post on his site introducing a new tool he's created allowing for the easier creation of tests for your Laravel application: the TestTools Chrome extension.

Testing a Laravel application really is an easy task - the "Integrated" package from Jeffrey Way, that later got merged into the core framework is fantastic and helps you with the otherwise cumbersome task of testing and interacting with your application. But still - are you actually using tests?

A lot of times people really love the idea of tests, but simply don't get their asses up to start using them in their own projects. That's why I created a chrome extension that hopefully saves you some time when you need to test your app

He also includes an animation or two of the Chrome extension in action, showing you what kind of results you can expect. He does point out that there's some limitations of the tool including the fact that you can't really test a single-page application with it as it relies on the normal browser interaction points, not Javascript events.

tagged: laravel testing unittest chrome extension browser

Link: http://marcelpociot.com/blog/2016-03-21-laravel-testtools

Rob Allen:
Testing Slim Framework actions
Mar 14, 2016 @ 10:45:52

Rob Allen has a quick post to his site showing you how to test Slim actions using PHPUnit and some simple pieces of the Slim framework itself to set up the needed environment.

To test a Slim Framework action, you need a request and a response object and mock whatever is in the action. This is one way to do this.

He gives an example of a simple endpoint that just returns a JSON string. He shows the code for this endpoint and how it registers with the application for an /echo route. He then gets in to the testing on the route's matching class, making an instance of the Request class and an Environment for it to work in. He ends the post by sharing teh code to pull all of these pieces together in a simple PHPUnit test that uses the assertSame assertion to verify the JSON response output.

tagged: slimframework action unittest phpunit testing tutorial request environment

Link: https://akrabat.com/testing-slim-framework-actions/

Full Stack Radio:
37: Chris Hartjes - Getting Started with Testing
Mar 09, 2016 @ 13:22:10

The Full Stack Radio podcast has posted their latest episode, Episode #37, featuring an interview with Chris Hartjes, most well known for his promotion and teaching about writing tests (unit, functional, integration, etc) for your applications.

n this episode, Adam talks to the Grumpy Programmer himself about getting started with testing PHP applications.

Topics include: recommended testing tools, PHPUnit vs. phpspec, Mockery vs. Prophecy, the benefits of defensive programming and how to convince your manager to let you write tests.

They also mention Chris' new book "Minimum Viable Tests" and the Patchwork monkey patching library. You can listen to this latest episode either using the in-page audio player or by downloading the mp3 of the episode directly. Be sure to subscribe to their feed or follow them on Twitter for more information as new episodes are released.

tagged: fullstackradio chrishartjes testing gettingstarted tools defensive programming manager

Link: http://www.fullstackradio.com/37

php[architect]:
March 2016 Issue Released - Mutant Testing
Mar 02, 2016 @ 11:09:08

php[architect] has officially released the latest edition of their magazine for March 2016 - Hunting Mutants. This new issue includes articles about compilers/interpreters, Laravel's Eloquent ORM and Zend Expressive.

Unless you’ve been cryogenically frozen for the past few years, you’ve no doubt heard about how important automated testing is as well as TDD, BDD, Continuous Deployment, and other acronyms. Either you’ve read an article in a past issue of this magazine or you’ve heard it from numerous advocates at conferences, on blogs, and on twitter. This month’s issue features two articles on Mutation Testing with Humbug.

This month's article also includes a free sample, the article covering Eloquent, the ORM for the Laravel framework. All of the usual columns are back in this edition as well including the Education Station, Leveling Up and the Security Corner. You can pick up an issue of your own directly from the php[architect] site for just $6 USD or a full year's subscription for $49 USD.

tagged: phparchitect magazine march2016 mutant testing issue release

Link: https://www.phparch.com/magazine/2016-2/march/

Joeri Timmermans:
Testing drag and drop with Behat and Guzzle
Feb 26, 2016 @ 12:28:58

Joeri Timmermans has posted a tutorial to his site showing how you can test drag-and-drop functionality with a combination of the Behat BDD testing tool and the Guzzle HTTP library.

As you could see in previous posts I'm working on a large application for Intracto where they want a lot of fancy visuals and this turned into a mess when it came to write behat tests. This post will help you test position moving with drag and drop.

In his case he was working with a chapter layout that allows for the rearranging of chapters to update their order. The process is then broken up into a few different steps:

  • Creating a new context feature for Behat (based on this example)
  • Making a custom action that makes it easier to move the chapter entries around by just providing positions
  • Calling the move in the Behat test itself

The tricky part here is that the actual test is made for the behavior but the behavior itself is making an API call to rearrange the pages. The test is making this same call and evaluating the result. It's not actually interacting with the page as you might be able to do with something like PhantomJs however.

tagged: testing draganddrop functionality guzzle behat api position chapter tutorial

Link: http://www.pix-art.be/post/testing-drag-and-drop-with-behat-and-guzzle

Magium Blog:
3 Best Practices for Selenium Testing when Constructing Your Page
Feb 17, 2016 @ 09:55:26

In a new post to the Magium site Kevin Schroeder shares three helpful tips you can use for the Selenium testing of your application based on some of his recent development on the project.

Having spent now about two months building out Magium there are a couple of things that are worth sharing as I’ve been working through several different versions of Magento. These practices (best practices?) may or may not be “officialized” by the Overlords of the Internet but what I have found is that I have the most trouble when these practices are not executed.

The basic premise behind each of these is that the quickest path to the most specific element is best.

His three tips avoid things like long XPath expressions to locate single items and favor consistency and simplicity:

  • Wrap ALL text in an HTML element – leave no orphaned text
  • If an element has function, identify it.
  • Group data using classes and IDs

He ends the post with a reminder that a well-structured page not only helps with testing but is also a good goal to strive for related to maintainability.

tagged: selenium testing magento tips top3 structure

Link: http://magiumlib.com/blog/3-best-practices-for-selenium-testing-when-constructing-your-page/