Blog posts tagged with symfony2

Mocking Symfony Container services in Behat scenarios with Mockery

Mocking objects in unit tests is pretty straight forward as every object used in a test case is usually created in a scope of one test class. In functional tests it's a bit harder since we either don't have full control over objects being created or it's simply too laborious to mock half the framework. Instead of functional tests I'm using Behat. In the context of this blog post it satisfies the same need - verifies the external behavior of an application.

Fixing failing Behat scenarios in large suites

In projects I currently work on I'm taking the BDD approach really seriously. In one of my Symfony2 projects I ended up with quite a lot of Behat features and scenarios which one day started failing on the integration server. The problem was in MySQL returning "too many connections" response.

Managing object creation in PHP with the Symfony2 Dependency Injection component

Symfony's DependencyInjection component is a PHP implementation of a Service Container, or as others like to call it, a Dependency Injection Container (DIC). The component also provides useful tools for handling service definitions, like XML loaders or dumpers.

Symfony 2.0 released!

Today, 28th of July 2011, Symfony 2 was announced stable. We've been waiting long but it was worth it!

Finding files and directories in PHP with Symfony2 Finder component

Symfony Finder component makes the task of finding files and directories less tedious. It supports filtering by name, pattern, size, date of modification and few other criteria. As a result we get objects of class SplFileInfo. It offers convenient way of retrieving file and directory details.

Creating parametrized command line scripts in PHP with Symfony2 Console component

Symfony Console component enables us to create commands in PHP. It does all the nasty work of handling input and output.

Autoloading classes in an any PHP project with Symfony2 ClassLoader component

Symfony ClassLoader component is a PSR-0 standard compliant PHP class autoloader. It's not only able to load namespaced code but also supports old-school PEAR standards (also used by Zend Framework). It's a perfect class loading tool for most of PHP projects.

Nginx configuration for Symfony projects

Recent release of Nginx 1.0.0 triggered me to refresh my knowledge about its configuration options. There were quite some additions since I looked in the docs for the last time. New variables and directives let me to simplify my configuration for Symfony projects (both 1.x and 2).

Multistage deployment of Symfony applications with capifony

Capifony is a collection of Capistrano deployment recipes for both symfony and Symfony2 applications. Multistage is an extension for Capistrano which enables deployments to multiple servers with varying configurations or deployment procedures.

Things I like about the new Symfony2 Form Component

Forms Refactoring, the last big change and recently most awaited pull request for Symfony2, was finally finished last Sunday. The work is not fully done but it's ready for merge. Request is still waiting for approval and as soon as it's accepted (or rejected) we can expect a beta release.

Learning Symfony2 by Unit Testing (Contribute to Learn)

During the Hacking Day on the Symfony Live conference I decided to give it a try and write some unit tests for Symfony2. I'm a big fan of TDD for quite some time already and I recently became really interested in BDD. For sure I'm not new to unit testing. Still, I didn't expect that writing tests for an existing piece of software can be so much fun.What I also discovered is that writing unit tests for Symfony is a great way to learn its internals.

Symfony Live 2011

I'm writing this post on a way back from the second international Symfony Live conference. Nearly 500 developers arrived to Paris from all over the world to participate in this great event.

Doctrine2 and Symfony2

I continue exploring the Symfony2 framework. It's flexible enough to be used with any modern PHP ORM. However, as with everything in Symfony2, there are sensible defaults provided. In case of an ORM it's Doctrine2 bundle.

Setting up a bleeding edge Symfony2 project

Symfony2 is not ready yet. Since the release is planned for March this year and I just can't wait any longer I started to play with it more seriously.I also want to know all those nitty-gritty details. Therefore I didn't go for sandbox and decided to generate a fresh project.

Heard in the Community (2010.08.01)

Symfony2 development moves forward quickly. Last week the API documentation was generated and put online by Fabien Potencier. Also, the translation process is now described so translators can start contributing.

Heard in the Community (2010.07.25)

"Heard in the Community" series aims to wrap up news from the PHP, symfony and other communities I find interesting and follow.