Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Full stack BDD for Symfony2

Full stack BDD for Symfony2

Many Symfony2 developers have heard about Behat and even use it regularly in their Symfony projects. If you have found value in this tool and the BDD practices it was inspired on, come join us for this talk as we will expand on what other benefits these practices and other BDD tools available can bring. This very illustrative talk will not only present you with the tools but show how to use them together to build beautifully architected, business-oriented Symfony2 applications.

https://joind.in/7064
https://github.com/everzet/fullstack-bdd-sflive2012/commits/master

Konstantin Kudryashov

September 14, 2012
Tweet

More Decks by Konstantin Kudryashov

Other Decks in Programming

Transcript

  1. • Where are we coming from • Why BDD •

    Behat Best Practices • Introducing a new tool This talk
  2. They act their way into a new way of thinking

    Adults don’t think their way into a new way of acting
  3. Test ? ? ? ? ? ? ? ? ?

    ? ? ? ? ? ? ? ? ?
  4. public function testUpdateWithEqualTypes() { $installer = $this->createInstallerMock(); $manager = new

    InstallationManager('vendor'); $manager->addInstaller($installer); $initial = $this->createPackageMock(); $target = $this->createPackageMock(); $operation = new UpdateOperation($initial, $target, 'test'); $initial ->expects($this->once()) ->method('getType') ->will($this->returnValue('library')); $target ->expects($this->once()) ->method('getType') ->will($this->returnValue('library')); $installer ->expects($this->once()) ->method('supports') ->with('library') ->will($this->returnValue(true)); $installer ->expects($this->once()) ->method('update') ->with($this->repository, $initial, $target);
  5. • No examples until you have a red step •

    No code until you have a red example • No more code than enough to make it green • Don’t get carried away! BDD Rules
  6. • Favour MinkAwareInterface over MinkContext • Extract context per role

    • Group features under feature folder • Use Mink API • Integrate with framework at config level Behat tips
  7. Questions ? ? ? ? ? ? ? ? ?

    ? ? ? ? ? ? ? ? ?