This blog was decomisionned
I am now blogging here, where all the important articles moved.
This blog with all its articles will go away in couple of months...

Three Goblin Art
taylor price
Misplaced Lens Cap
Show & Tell
One Nice Bug Per Day
I'd rather be in outer space đ¸

blake kathryn
hello vonnie
Claire Keane

Love Begins
h
wallacepolsom
Aqua Utopiaď˝ćľˇăŽĺşă§č¨ćśăç´Ąă

romaâ
ojovivo
trying on a metaphor
Monterey Bay Aquarium

seen from United States

seen from United Kingdom
seen from United States

seen from United States
seen from United States

seen from United States
seen from Netherlands
seen from United States
seen from United States
seen from United States

seen from United States

seen from United States

seen from France

seen from United States

seen from United States

seen from Malaysia

seen from New Zealand

seen from Malaysia

seen from United States
seen from Brazil
@everzet
This blog was decomisionned
I am now blogging here, where all the important articles moved.
This blog with all its articles will go away in couple of months...

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch ⢠No registration required ⢠HD streaming
Conceptual difference between Mockery and Prophecy
Today I've been asked twice what's the difference between Mockery and Prophecy just to suddenly discover that I didn't clarify this aspect never before. Well, that's about time.
If we were to remove all the syntactical and implementation differences between two libraries what we'll be left with is one really big conceptual difference and it's the fact that in contradiction to Mockery, Prophecy puts messaging (aka how objects communicate) before structure (aka when objects communicate).
Me and Mathias decided at the PHPNW13 conference to start a PHP podcast about design, BDD, DDD and other DDs. Making first episode was extremely easy. If you guys like it, plan is to make one short (30 mins) episode per week. Should be fun.
With B for 3
Today is a third birthday of Behat. Exactly three years ago I did first commit to Behat repository. And it was quite a ride, wasn't it?
Where we (community) are
3 years is quite a short time for a tool (PHPUnit is on the market for at least 10 years) But we achieved quite a lot in that time! We have delivered tens of BDD talks across the world, written tens of commercial products using it and even driving development of OpenSource e-commerce framework using BDD. Damn, even Drupal community now talks about awesomeness of BDD and Behat. Isn't that an achievement? In community that was bashed about poor software quality for years... Well, what can I say? Empire strikes back!
Community
All this wouldn't be possible without amazing community of users and contributors. 42! people contributed to Behat over its lifetime including headrevision, davedevelopment, robocoder, stof and many-many more. And if you think that it's my personal project, you're wrong :) This third year in a row this community looks better than ever and that's every single contributor achievement. Thank you all for that! And keep doing that awesomeness with doubled effort! I'm counting on you, guys...
Family
Talking about people without which this all wouldn't be possible, I can't avoid talking about my lovely wife - Tati. Without her, all this craziness wouldn't ever become true! Simply because I'd die of stress, loneliness and starving long before v1.0 release :) She's the biggest driver and supporter behind everything I'm doing and pretty much the reason why I'm doing all that.
Thank you, honey, you're one of the biggest Behat development supporters out there!
What's next
So, what's next? First of all, new website is right aroudn the corner with much bigger emphasis on community and extensions. Support for extension self-publishing on the behat.org will become a big part of it.
Second, and even more important, be prepared for more coolness (with minimal amount of BC breaks, of course). In the next month I'll push the first preview release of vThree.0. What's there? Well, three of the most requested features by the community:
Multi-contextual runs with support for per-tag, per-directory and per-role context classes. This "importance of the role" mantra I was always preaching will finally become possible as each role will eventually be able to have own steps dictionary.
Multi-bundle support for Symfony2Extension. Finally you'll be able to test all your project and 3rd-party bundles in one run. Yay?
Multi-worker support. Which is basically an ability to distribute your single feature suite testing across multiple CPUs or even machines, combining output on one machine.
Those changes pretty much required from me a rewrite of the testing core, which is now sort of hexagonal. So even though there wouldn't be a lot of those, there will be BC breaks.
BC breaks are bad for community. I learned that a hard way :) So, in order to neglect upcoming BC problems, in coming weeks I'll also release Behat v2.5.0. This will be the first Behat LTS release with 2 year bugfix support cycle. That will hopefully give you calm about your existing suites ;)
Hope all this stuff will make you as happy as it makes me, guys. Crazy times ahead!
Thank you
Once again, I wanted to say thanks to amazingly vibrant community behind Behat. Without you, nothing of this would be possible.
This is my personal "thank you" and congratulations for our achievements! Tomorrow we'll have professional "thank you" from Inviqa with couple of surprises. Stay tuned!
In which he leaves KnpLabs and joins Inviqa
Today is my last day at KnpLabs. Next week me and my beloved wife are flying to London, UK to join awesome team at Inviqa. This post is a "thank you" letter to an amazing team I'm leaving behind, explanation for that decision and a "hello" letter to an amazing team I'm joining at Inviqa.
Amazing team I'm leaving
Those 2 years in KnpLabs was an amazing experience. I worked with one of the best PHP teams in the world on some of the hardest PHP projects using tools and technologies that constantly questioned my knowledge. Working directly with PHP experts like @docteur_klein, @herzult, @l3pp4rd, @weaverryan and many others is overwhelming. All of us had expertise in different areas, which we were bringing into every Symfony2 project we were working on. From my side, it was obviously Agile, Scrum & BDD. By doing so I learnt how important it is to build and maintain correct development processes inside a team and how drastically development process could change your team. For all this and even more I'm extremely thankful to @mbontemps, who brought me in more than 2 years ago. Thank you, Matt! And thank you to everyone in KnpLabs for being so awesome!
Reasoning
Last year I discovered that described above BDD metamorphosis that was happening in KnpLabs team is not limited to KnpLabs. It started happening everywhere in the PHP world - in every team and community that got into BDD, including Drupal, Yii and others. But probably the biggest Behat explosion happened through autonomous growth of Behat Users group in London, city where ironically this all (LTDD, BDD, Cucumber) started. I was and still am extremely excited about all that. Some technology I'm working on & truly believe in is working with amazing results for everyone who wants to dive into it. Problem? Not everyone wants to dive into it just yet :) Suddenly I realised that I have responsibilities for PHP community. It's not about me and my team anymore - it's about every team in the entire PHP world and I need to help moving it forward. So, keeping this in mind, there's simply no better place in the world to start growing BDD inside PHP community than London. And there's simply no better company in the world to start doing it from than Inviqa.
Amazing team I'm joining
So, Inviqa. Everything you need to know about it in couple of bullets:
It is a group of companies such as Session Digital & SensioLabs UK
It has most impressive collection of PHP professionals I've seen to date, including (but not limited to) Alistair Stead, Mark Baker, Rowan Merewood, Jakub Zalas and many-many-many others
Mr. PHP-SpecBDD, Marcello Duarte works there
It has friendliest CEO I've ever met - Mr. Yair Spitzer. He's the man you should tweet "thank you for bringing @everzet here" right now!!!
Inviqa is a big company with ton of expertise in absolutely every area of PHP world, including brightest corners like Symfony2, Magento & Drupal. Our job with Marcello basically would be to absorb all that experience and bring awesomeness of BDD and tools like Behat and phpspec2 into each and every one of those communities. I have 2 personal goals for years ahead - to increase growth of BDD/TDD inside PHP community and to bring correct processes into every PHP team in the world, including Inviqa Group itself. Awesome detail is that everyone in this company shares our with Marcello vision, which is freaking amazing! To every single person in Inviqa - hello, you're amazing, we'll change the world together!
To wrap this up, I want to say that I'm little bit sad about leaving an amazing team and company that gave me so much fun, opportunities and experience as a "Lead Web Developer". But I also incredibly excited about joining incredible team and company where I can literally change the world (we'll start from PHP) as a "BDD Practice Manager". See you in London!

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch ⢠No registration required ⢠HD streaming
This tune is insane! Everything I love in DnB and everything I miss in lazy dubstep...
Ah yeah! Finally great dnb tune. Even if in form of dubstep track remix :-P
New #Deftones LP and it's amazing again!
Great talk about why newcomers get BDD wrong.
All you generally need to know to understand what is StoryBDD.

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch ⢠No registration required ⢠HD streaming
Luv this guy's work so much...
âĽâĽâĽ track of the month âĽâĽâĽ
Autohosts for Symfony projects on Mac
We all know, that web development is not as easy as it sounds and that it involves lot of different and sometimes really complex tools to just run or test stuff. We also know, that bootstrap (setup) of the project could take more time than you want it to. It's not a big deal if you're working on single project full time, but at KnpLabs, i'm bootstraping new sf2 project every 2 weeks. So this manual crafting of virtual host, edition of /etc/hosts and maintaining of those temp hosts everywhere made me really sick. So, at some point i've started to look for an elegant solution. Here is it.
Apache2 supports autohosts out of the box - you just need to configure them. On Mac it's really easy, just put:
NameVirtualHost *:80 UseCanonicalName Off <Directory "/Users/YOUR_USER/Sites/*/web"> AllowOverride All Allow from All Options +FollowSymLinks </Directory> <Directory "/Users/YOUR_USER/Sites/*/web/cgi-bin"> Allow from All Options +ExecCGI </Directory> VirtualDocumentRoot "/Users/YOUR_USER/Sites/%0/web"
into vim /etc/apache2/users/autohosts.conf. After that restart Apache (sudo apachectl restart) and forget this action (apache restarting) forever. From this point, every subfolder with web subdirectory inside your ~/Sites folder will be autoloaded as proper vhost. No need to restart Apache, just put your shiny downloaded symfony distribution into ~/Sites/symfony.dev and you'll automagically will have virtual host for it.
Awesome, right? Well... not yet. You still need to add 127.0.0.1 symfony.dev to your /etc/host. But no worries, i have solution for this problem too - we'll use local DNS forwarder for that. It's easier than it sounds, actually:
First, install dnsmasq. I use homebrew for that:
$> brew install dnsmasq
Next, copy default dnsmasq configuration:
$> cp /usr/local/Cellar/dnsmasq/2.63/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
And add dev domain resolving rule to it:
$> print "address=/dev/127.0.0.1" >> /usr/local/etc/dnsmasq.conf
Copy launch list to autostart dnsmasq on boot:
$> sudo cp /usr/local/Cellar/dnsmasq/2.63/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons
And run it:
$> sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
Next step is to add rule for dev domain to resolver configuration:
$> sudo print "nameserver 127.0.0.1\ndomain dev" > /etc/resolver/dev
And general rule, which will be used when you're offline (without internet connection) as there's bug in Mac OS resolver service:
$> sudo print "nameserver 127.0.0.1\ndomain ." > /etc/resolver/offline
And that's it. You're ready to go. Download latest symfony version from symfony.com, put it into ~/Sites, add .dev suffix and you have working website with virtual host on your local machine.
P.S.: You might need restart your WiFi in order to update resolver config.
Video of my talk from "Symfony Live 2012: Paris". "Behat by Example"
Slides: https://speakerdeck.com/u/everzet/p/behat-by-example
phpspec2: SUS and collaborators
Good evening my dear BDD practitioners. Today is the first day of the new era. Era of full stack BDD in php. Today weâve released first (and even second one, couple hours ago) alpha release of the first real SpecBDD tool for php - phpspec. Weâre really happy about this tool, what it offers and especially development style it enforces. There are lot of improvement to traditional testing tools inside, but also, plenty of things that not only different but unusual for other frameworks in the area (even SpecBDD ones).
First of all, phpspec2 is not a testing framework. Itâs a SpecBDD tool. It means, testing is not our primary aim. Toolâs job is to enforce and make SpecBDD in project flawless and phpspec2 uses all available methods to do that - state of the artformatters, class and method generators and lot of othe fancy buzzwords :) Today, i want to explain you the heart of phpspec2 - SUS, collaborators and prophets.
SUS
SUS stands for Subject Under Specification. SUS is this thing youâre currently describing in opened specification. Itâs this unexisting object, on which youâre calling unexisting methods and assuming future outcomes. Most important thing? There could be only one SUS in specification. It means, youâre always describing one object at a time. Because you hardly could concentrate even on single unexisting subject. Forcing yourself to concentrate on multiple is like suicide.
Iâve told you already, that phpspec enforces some specific development style. In this particular case, development style is one subject per specification. How phpspec2 enforces it? It just doesnât give you ability to describe expectations about other subjects. You just donât have any easy way to do nasty (in SpecBDD terms) things :) You have no choice except doing things right. And believe me, it wouldnât take long to see benefits.
So, in phpspec2 single Specification describes single subject. What is Specification? Itâs list of examples about how your object should behave! And what happens when thereâs only one subject possible? You find abilities to make things cleaner. If thereâs only one object youâre interested at a time, then you could just say this:
$this->getTitle();
Awesome, isnât it? Thatâs how you describe objects with phpspec2. Youâre pretending that youâre inside this object and describing itâs behavior and your expectations about it through matchers:
$this->getTitle()->shouldReturn(âmyselfâ);
This is possible, because in phpspec2 your SUS is wrapped into special object, called Prophet. This object can proxy method or property calls into original object and make assumptions about return values using matchers. Coolest thing about that? When thereâs no object or method implemented yet (usual stuff for BDD), instead of fatal error, youâll get clean exception message, and even more - thereâs special exception listener, which will offer to generate this class or method for you.
Also, all return values from your SUS are wrapped into this Prophet object too:
$this->getPayment()->getType()->shouldReturn(âvisaâ);
Collaborators
Ok, you can describe your object and make assumptions about itâs self-consistent behavior. But we know that world is much more complicated than that. In real world, most objects are interacting with each other. For each object in the system, thereâs at least one collaborator object, which communicates with your SUS:
public function payWith(CreditCardInterface $card) { $card->withdraw($this->amount); }
There are 2 ways to handle such situations in classical world of testing - classical and mocking approaches. In terms of TDD, itâs Classical and London TDD. First (classical) operates with real or almost-real objects. Every time you need collaborator, youâre instantiating real object for that. Mockists (LondonTDD) approach is to mock all the collaborators. This way, you can concentrate on thing that matters right now and keep actual collaborator behavior for later explanation. In TDD world, there are 2 camps of developers - classicists (those, who prefer classical approach) and mockists (those, who prefer mock everything). How it relates to phpspec2? SpecBDD is mockists methodology :) Simply because you canât avoid insanity if youâll try to describe 5 objects through classical approach without implementing those 5 objects :) SpecBDD tells you - concentrate on single object at a time. And thereâs only one way to do that - through mocks.
Again. Iâve told you already, that phpspec enforces some specific development style :) In this particular case, development style is mocking every collaborator. In phpspec2, you have examples instead of test cases. And examples could have dependencies (which are collaborators). And in php, method dependencies are defined through arguments, right?
public function it_should...($mock1) { $mock1->beAMockOf(âSome\Classâ); }
Yeah, this looks little bit unnatural. Thatâs why weâre using natural phpdoc syntax to define them usually:
/** * @param Some\Class $mock1 * @param Some\OtherClass $mock2 */ public function it_should...($mock2, $mock1) { }
Easy, right?
Ok, phpspec2 forces you to use mocks as collaborators. But it doesnât mean you need to deal with ugly mocking system youâve seen in other tools before. In case, where 50% of your development process are mocks, those mocks should be simple. But in most cases, mocks arenât simple, arenât they? Thatâs because usage of mocks usually involves couple of complex stages to be done during their usage:
// 1. expectations definition $payment = $this->getMock(âPaymentâ); $payment ->expects($this->once()) ->method(âpayWithâ) ->with($visa); // 2. execution $bank->process($payment); // 3. check expectations
You see, thereâs at least 2 stages every time you use mocks:
definition stage - youâre defining what methods should be called and how
execution stage - youâre executing those methods
checking stage - youâre checking expectations
In most modern frameworks, stage 3 is hidden, so you only have to deal with first 2. Good, but you still need to work with cumbersome syntax just to differentiate expectations definition from execution stages. Do you? In my opinion - no. In my whole developer life i havenât seen case where execution happens inside test case or example code (on the first level i mean). In test case youâre always defining expectations. Then why do you need to use this differentiation-driven syntax? In phpspec2, you donât:
$mock->getTitle()->willReturn(âphpspec2â)->shouldBeCalled();
Meet the phpspec2 mock. Yup, getTitle() method should be called without arguments and when it is, itâll return phpspec2. Ok, but in most cases you donât care whether it will be called or not. The only thing you care about is that when it does - it should return something. Itâs called stubbing. In phpspec2, stubs look like that:
$mock->getTitle()->willReturn(âphpspec2â);
Whatâs the difference? Thereâs no shouldBeCalled() method. Ok, letâs go to complext case. How to mock this:
public function prettify($string) { return sprintf($this->format, $string); }
Itâs so-called proxy-method. In phpspec2, youâll stub it like that:
$mock->prettify(ANY_ARGUMENT)->willReturnArgument();
This stub will be matched to any prettify() call with any single argument. And when itâs called, itâll return this argument. Thatâs phpspec2 collaborators.
So thatâs it for today, just go and try it! And donât forget to check demo video for it.

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch ⢠No registration required ⢠HD streaming
Yesterday we've released first ever alpha version of phpspec. Check out official webpage: http://phpspec.net and spread the word ;)