Vagrant environment for Symfony2

If you’re a developer, A virtual machine can isolate dependencies and their configuration within a single disposable, consistent environment, without sacrificing any of the tools you’re used to working with (editors, browsers, debuggers, etc.).

For this reason I’m going to explain how to setup a vagrant vm to work with your Symfony2 project.

What is Vagrant?

Vagrant is free and open-source software for creating and configuring virtual development environments. It can be considered a wrapper around virtualization software such as VirtualBox and configuration management software such as Chef, Salt and Puppet.

Installation

Once you have imported the project as a submodule (or just clone it if you dont want to add it as a submodule)

The first time can take a couple of minutes because you will download the operative system ISO for the VM.
When the VM is done setting up, point your browser towards http://192.168.33.10 and there you have it: Symfony2.

PHPUnit 4 released

A few days ago Sebastian Bergmann released version  4.0.0 of PHPUnit. I was expecting more new features due to this major version, but it did not happened. I will describe some of my favourite changes in this new version.

– Implemented #813: Added @before, @after, @beforeClass and @afterClass annotations.

@after
The @after annotation can be used to specify methods that should be called after each test method in a test case class.

@afterClass
The @afterClass annotation can be used to specify static methods that should be called after all test methods in a test class have been run to clean up shared fixtures.

– Implemented #834: Added the @requires OS annotation. ( A regexp matching PHP_OS )

Some considerations before migrating version:

– A test will now fail in strict mode when it uses the @covers annotation and code that is not expected to be covered is executed.

– All relative paths in a configuration file are now resolved relative to that configuration file. When upgrading, you may need to update relative paths for the following configurations: testSuiteLoaderFile, printerFile, testsuites/file, testsuites/exclude.

Changes in PHPUnit_MockObject:

– A more useful error message is now displayed when the stubbing or mocking of a method fails because a class or interface that is used in the method’s signature is not loaded.
– Implemented #108: Improved error reporting when invocation parameters don’t match.

Changes in PHP_CodeCoverage:

– Migrated the HTML report from Bootstrap 2.3 to Bootstrap 3

My First Post

There are many reasons for starting this blog. Firstly as a way to keep track of all my tips, tutorials, code snippets and various web projects. I like to be active in the world of web development and have been knocking out sites and libraries for years.

Secondly I wanted somewhere to document all my trips and experiences around the world and also all my life hacking improvements.

Finally, it will be a convenient place to dump my thoughts on PHP, MySQL, nginx, JS, and the world of computers in general.

So welcome, and thanks for reading.