News Feed
Sections




News Archive
feed this:

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

Mathias Verraes:
Economy of Tests
January 05, 2015 @ 11:48:02

Expanding on the previous post about how much testing may be too much, they're back with another post in the series, this time focusing on the "economy of tests". This time Mathias is joined by Konstantin Kudryashov as a co-author.

A common complaint with teams that first try their hand at automated testing, is that it is hard, costly, and not worth the effort. On the other hand, supporters say that it saves them time. In this post, we'll try to add some nuance to the discussion. We'll take a look at how different levels of automated testing affect the cost of development, both in the short and the long term, for both greenfield and brownfield projects. Finally, we'll look at a simple strategy for introducing tests and migrating them across test levels, in order to reduce maintenance costs.

They start with some baseline definitions so everyone's on the same page - unit test, integration testing and system testing. The article also covers some of the basic kinds of testing metrics including execution speed, fragility and understandability. It then moves on and looks at the other major final factor in the overall cost of testing, the age of the project (new vs existing). He mentions the Testing Pyramid, how it's recommended to migrate tests and some of the common opposing forces to the test migration/creation.

0 comments voice your opinion now!
unittest testing economy existing new project definition pyramid

Link: http://verraes.net/2015/01/economy-of-tests/

Robert Basic:
Mocking hard dependencies with Mockery
December 26, 2014 @ 11:14:51

Robert Basic has a post today showing how you can mock hard dependencies with Mockery, a mocking library for use in unit testing. In this case, "hard" refers to work around the use of "new" creating objects in hard to test places.

One problem with unit testing legacy applications is that the code has new statements all over the place, instantiating new objects in a way that doesn't really makes it easier to test the code. Of course, the easy answer to this is "Just refactor your application!", but that's almost always easier said than done. If refactoring is an option, do it. If not, one option is to use Mockery to mock the hard dependencies.

He makes use of instance mocks to show the overloading of the service without the need for a refactor. This overrides it on a more global scale, so it could have an effect on other tests. He shows how autoloading and PHPUnit's own process isolation handling can fix tis problem (though it takes more time to run the tests this way). He includes sample code of the whole process so you can easily follow along too.

0 comments voice your opinion now!
mockery dependency hard new instance phpunit unittest

Link: http://robertbasic.com/blog/mocking-hard-dependencies-with-mockery

NetTuts.com:
PHP 5.6 What's New
October 02, 2014 @ 10:58:59

On the NetTuts.com site there's a new article posted talking about some of the new stuff that comes bundled in PHP 5.6 (the first stable version of which was released at the end of August 2014).

It's been a long time coming, but we finally have a new version of PHP. With it comes a some nice, new features, improvements to existing features, as well as features that have been removed or marked as deprecated. Let's dive in and take a look at everything that's offered by the latest version.

There's several items on the list, broken up into various sections, each with brief explanations:

  • Backward Incompatible Changes (ex: json_decode, mcrypt)
  • New Features (including constant scalar expressions, argument unpacking, phpdbg)
  • Deprecated Features (call to static from non-static context, removal of HTTP_RAW_POST_DATA)

They also link to the list of all of the changed and new functions updated in the PHP 5.6.0 release and moving forward.

0 comments voice your opinion now!
php56 new feature deprecated backwards incompatible break

Link: http://code.tutsplus.com/articles/php-56-whats-new--cms-22101

Ben Ramsey:
Learning a New Codebase
September 18, 2014 @ 09:38:51

In a new post to his site Ben Ramsey shares a few suggestions around things to ask and do to learn a new codebase (whether that means in a new job or coming into a new open source project).

A few days ago, my friend Ed Finkler started a new job. Earlier this week, he posted on Twitter: "First days humble us all." Having begun a new job myself, I shared Ed's sentiment. Last weekend, while at the Madison PHP Conference, we were discussing what developers can do during the interview process to get an idea of the kind of codebase a company has.

He includes a few questions for developers to ask, either during the interview or once hired, about the codebase itself including:

  • what coding standards the company follows
  • how much of the code is covered by tests
  • have the company's deployment process described

He also recommends learning the codebase by diving in and either writing tests for untested areas or work through bug reports and fix (then test) them.

0 comments voice your opinion now!
learn new codebase tips questions bugfix unittest

Link: http://benramsey.com/blog/2014/09/learning-a-new-codebase/

SitePoint PHP Blog:
New Features in PHP 5.6
January 14, 2014 @ 12:56:39

On the SitePoint PHP blog Bruno Skvorc has posted a guide to what's new in PHP 5.6, the upcoming release of the language.

It's been a while since the release of PHP 5.4, and new versions have been coming out faster and faster ever since. When 5.5 hit and introduced some unexpectedly great features, the PHP community breathed a sigh of relief and regained hope of a more dedicated, structured and smart core development. Whether or not we'll actually get this remains to be seen, but the future does indeed look promising, especially if one looks at the PHP 5.6 changes made so far.

He goes through the list of things (so far) that will be in the upcoming release:

  • MIME types in the CLI web server
  • Internal Operator Overloading
  • Uploads of over 2GB are now accepted
  • POST data memory usage decreased
  • Improved syntax for variadic functions
  • Constant Scalar Expressions
  • PHPDBG bundled by default
  • Zip improved
  • Importing namespaced functions

Each item on the list comes with either some sample code to show its use or a brief explanation of the features it adds or updates.

0 comments voice your opinion now!
new feature upcoming language release php56

Link: http://www.sitepoint.com/new-features-php-5-6

The PHP.cc:
PHP 5.5 New CLASS Constant
June 26, 2013 @ 09:02:08

The PHP.cc have posted another article in their series looking at the new features that come with the latest release of PHP (5.5). In this new post they cover the "CLASS" constant.

Last week, the first stable version of PHP 5.5 was released. It introduced a class-level constant, aptly named CLASS, that is automatically available on all classes and holds the fully-qualified name of that class. [...] So why would you need such a constant? [...] When you need the fully qualified name of a namespaced class that is referenced by a namespace alias ... then it gets interesting.

He illustrates with an example of a unit test using stubs and mocks. The normal method requires the definition of the class namespace in the "getMock" call. With the CLASS constant, PHP can extract that information from the namespace referenced in the "use" and drop it in as a replacement.

0 comments voice your opinion now!
class constant php55 new feature namespace unittest

Link: http://thephp.cc/viewpoints/blog/2013/06/php-5-5-new-class-constant

PHP.net:
PHP 5.5.0 released
June 20, 2013 @ 14:13:20

The long awaited release of PHP 5.5 has finally happened - 5.5.0 has been made available via the PHP.net site (and mirrors).

The PHP development team is proud to announce the immediate availability of PHP 5.5.0. This release includes a large number of new features and bug fixes. [...] For users upgrading from PHP 5.4 there is a migration guide available here, detailing the changes between PHP 5.4 and PHP 5.5.0. For a full list of changes in PHP 5.5.0, see the ChangeLog.

There's a long list of new features that comes with this release as well including generators, "finally", class resolution via "class" keyword, support for list in foreach and the enabling of the Zend Opcode caching by default. You can download this release now from PHP.net.

0 comments voice your opinion now!
language version release v550 bugfixes new features

Link: http://php.net/archive/2013.php#id2013-06-20-1

NetTuts.com:
10 Tips for Learning a New Technology
May 10, 2013 @ 10:54:10

On NetTuts.com today they've posted a list of tips they think will help you learn a new technology faster. They've broken it up into ten different steps, some which could be done at any time but some have a bit more of an order.

We live in a very exciting time. Never before has education been so cheaply available to the masses (if not free). The medium, itself, has made tectonic shifts from a classroom setting, to blogs, screencasts and complete university classes, as a set of videos and interactive forums. Given these resources, there's absolutely no excuse not to dive in and learn. However, with such a wealth of resources, filtering through the options can often become overwhelming. In this article, I will outline a simple process to kick-start your education.

Among the items in their list there's things like:

  • "Let the Information Flow Begin"
  • "Listen and Watch"
  • "Blogging"
  • "Feel the Pulse"
  • "Meetups and Conferences"

Each tip comes with a bit of description and some links to other resources and tools that can help you along your way.

0 comments voice your opinion now!
learn new technology tips advice top10

Link: http://net.tutsplus.com/articles/general/10-tips-for-learning-a-new-technology

Sherif Ramadan:
Test Drive PHP 5.5 A Sneak Peek
October 22, 2012 @ 12:09:02

Sherif Ramadan has a new post that gets into some good detail about what you can expect in the upcoming PHP 5.5 release with loads of new features.

There's been some talk about PHP 5.5.0 over the past couple of months even though it is barely on the horizon. The reason for this is that the PHP project has seen some increased levels of activity over the last two years since the dawn of PHP 5.4 and now in to the early twilight phase of PHP 5.5.0-dev. For those of you that haven't been following the internals mailing list I'm about to give you a quick test-drive and sneak-peak at PHP 5.5 using the latest 5.5.0-dev branch (which is still TBD).

Obviously, since the actual release of this version has yet to be determined, some of this may change over time. He gets into some of the major advancements and features that will be included like:

  • the "finally" keyword
  • list() support in foreach()
  • the Password Hashing API
  • generators
  • a new property accessor syntax
  • scalar type hints

Code samples are provided in some places to help make a bit more sense out of the example.

0 comments voice your opinion now!
upcoming release version new feature functionality


Web & PHP Magazine:
Issue #6 Published - "Breaking New Ground"
September 03, 2012 @ 11:58:06

The latest issue of Web & PHP Magazine has been published - Issue 6, "Breaking New Ground". In this latest edition, articles include:

  • "Social Authentication with Zend Framework 2" by Nicholas Calugar
  • "A modern approach to object creation in JavaScript" by Marco Emrich
  • Sebastian Bergmann discussing reliability in software engineering
  • Scriptable sockets with ZeroMQ by Louren Naude

You can download this latest issue for free from the Web & PHP site and pick up the other previous issues while you're there!

0 comments voice your opinion now!
webandphpmagazine issue publish new technology



Community Events





Don't see your event here?
Let us know!


community conference interview configure laravel release voicesoftheelephpant opinion list api install introduction symfony unittest podcast composer version extension language series

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework