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

Alvaro Videla:
Using RabbitMQ in Unit Tests
May 01, 2013 @ 09:10:11

Alvaro Videla has a new post today showing how he used RabbitMQ in his unit testing runs with a small, quickly installed version of the server that can be removed once the tests are complete.

In this blog post I want to show you a very simple technique for using RabbitMQ in our Unit or Functional Tests. Let's say you wrote a bunch of tests for your RabbitMQ consumers and then it's time to run them. To do that you probably need to setup a RabbitMQ server just for tests with their own users and passwords, or you need to set up a whole new virtual host for your tests. [...] With a future release of RabbitMQ that we can already test on the nightlies website, we can run RabbitMQ without the need to install Erlang. We created a package that ships a stripped down version of Erlang together with the broker bits, so running RabbitMQ now is as easy as downloading a tarball, uncompressing it and starting the server.

With a combination of this more self-contained package and some listener handling through PHPUnit, they uncompress the tarball with a PHP script and start the server with the defined configuration. Then, once the tests are done, it cleans itself up and removes the entire server directory to make for a clean run the next time.

0 comments voice your opinion now!
rabbitmq standalone server erlang unittest phpunit

Link: http://videlalvaro.github.io/2013/04/using-rabbitmq-in-unit-tests.html

Paul Jones:
Symfony Components Sometimes Decoupled, Sometimes Not
January 03, 2013 @ 11:09:26

In this new post to his site Paul Jones talks a bit more about coupling in frameworks (see some of his recent Aura posts for more), this time looking at how the Symfony framework defines "decoupled" based on its object structure.

Previously, on decoupling and dependencies, I said: "Some [Symfony] commenters were dissatsifed with my use of unit testing requirements to discover what a package really depends on, as opposed to what its composer.json file states." I'm willing to allow that the Symfony commenters here might be right. Let's try looking at Symfony's claims and see how they stack up.

Based on a list of components Symfony says don't have mandatory dependencies, he finds that - out of the fifteen given - four of them do have dependencies.

Does having mandatory dependencies make it a bad project? Not at all. It just means their statement of "no mandatory dependencies" (and related statements) is not true for all the components listed. Now, it may be that the Symfony folk have a different idea of what "decoupled" and "standalone" mean.
0 comments voice your opinion now!
symfony framework component decoupled standalone


Padraic Brady's Blog:
The Mockery An Independent Mock Object and Stub Framework for PHP5
March 06, 2009 @ 10:28:58

Noting the lack of a good, independent library for creating Mock Objects for unit testing PHP scripts, Padraic Brady (with assistance from Travis Swicegood) has come up with a standalone Mock Object and Stub framework - Mockery.

It's not tailored specifically to any one testing framework, rather it's an entirely separate framework with a discrete API. The idea is that you can use this framework within PHPUnit, or SimpleTest, or anything else really, without being forced to rely on the built-in support (if any) that test framework provides. Mockery was designed specifically to implement a form of Domain Specific Language (DSL). It makes extensive use of a fluent interface mixed with methods to approximate plain English.

He includes an overview of what Mock Objects and Stubs are and how to set them up with the Mockery tool. He finishes things off with a look at the Mockery and Mock Object Expectation APIs. You can grab this first release either as a PEAR package or from its github page.

0 comments voice your opinion now!
mockery php5 stub testing unittest object simpletest phpunit standalone


Vinu Thomas' Blog:
PHP Compiler - Roadsend
April 24, 2007 @ 08:37:00

On his blog today, Vinu Thomas looks briefly at one of the compiler options for PHP developers - the Roadsend Compiler.

Finally an open source PHP compiler ! Roadsend was perviously available as a commerical compiler for PHP with prices starting from $129. They seem to have shifted to the OSS model recently, giving free professional licence to their older compiler while they're working on releasing the precompiled versions of their open source code base.

He also links to a community site that offers the latest news about the project, some good places to start if you're just picking it up, and the timeline/roadmap for how things will progress.

0 comments voice your opinion now!
compiler roadsend standalone community php4 compiler roadsend standalone community php4


DevShed:
A Basic Monitoring Engine in PHP
September 14, 2006 @ 13:44:19

Continuing on in their series of working with stand alone PHP scripts, DevShed has posted this third and last part looking at the creation of a basic script you can use to monitor your server (an excerpt from Advances PHP Programming by George Schlossnagle).

Last week, we continued our discussion of PHP standalone scripts with child processes and more. This week, we conclude our discussion and bring together what you've learned.

They start with the creation of a very basic daemon, including permission restrictions. They then modify this heavily to support the monitoring of processes through various parameters like frequency, status_time, and a description of the service. They then create the full example script and show the usage by checking to see if a URL passed in can be opened.

They also include, as a bonus, another more useful script that will email someone when the specified service goes down (still a HTTP check, though).

0 comments voice your opinion now!
part3 standalone script monitoring engine email http request part3 standalone script monitoring engine email http request


DevShed:
Managing Standalone Scripts in PHP
September 07, 2006 @ 16:19:52

DevShed continues their look at standalone PHP scripts (server-side scripting, not on the web) in part two, "Managing Standalone Scripts in PHP" excerpted from the book "Advanced PHP Programming" from George Schlossnagle.

Last week, we began our discussion of PHP standalone scripts. This week, we'll be talking about child processes, shared resources, signals, and writing daemons.

They jump right in, going first for a look at forking off child processes from the script using the pcntl functionality you'll need to build into PHP. Resource management is key to working with server scripts, and they show you how to close them out when you're through. Next up is a brief look at the types of signals that you can send to the child processes, and some good rules to follow for writing daemons in PHP.

0 comments voice your opinion now!
standalone script serverside daemon signal resources standalone script serverside daemon signal resources


DevShed:
Implementing with PHP Standalone Scripts
August 31, 2006 @ 10:46:37

DevShed has posted an excerpt from the book "Advanced PHP Programming" from George Schlossnagle as this new tutorial detailing the creation of standalone PHP scripts.

If you've ever been interested in making significant use of PHP outside of a web environment, this article will show you how. The first of three parts.

This chapter describes how to reuse existing code libraries to perform administrative tasks in PHP and how to write standalone and one-liner scripts. It gives a couple extremely paradigm-breaking projects that put PHP to use outside the Web environment.

In this first part, they groundwork is laid - they introduce the CLI interface PHP already has and show how to handle input/output and work with parsing the command line arguments passed in.

0 comments voice your opinion now!
standalone script tutorail book excerpt advanced standalone script tutorail book excerpt advanced



Community Events





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


podcast refactor threedevsandamaybe unittest list framework language opinion community testing code release wordpress interview developer configure install introduction series laravel

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