International PHP Conference
The Conference for PHP and Web Development

CakePHP Test Fixture Factories

Session
Until February 17:
✓ Save up to 723€✓ Workshop-Day for free
✓ Group discount
Register now
Bis 17. Februar:
✓ Bis zu 723 € sparen✓ Workshop-Tag gratis
✓ Kollegenrabatt
Jetzt anmelden
Until conference starts:
✓ 2-in-1 conference package
✓ Group discount
✓ Extra specials for freelancers
Register now
Bis Konferenzbeginn:
✓ 5-Tages-Special
✓ Kollegenrabatt
✓ Special Discount für Freelancer
Jetzt anmelden
Infos

CakePHP is known for featuring a powerful and intuitive convention-based Object Relational Mapper. But like many PHP frameworks, it shows limitations in the management of test fixtures.

One approach consists in loading or emulating a database dump before each test is run. Another one creates the test fixtures with the help of factories inside each test.

The first approach breaks the rule of test independence, and leads to opaque tests. We investigated the second approach, which delivers more intelligible tests. But as a trade off, tests got slower to write.

Really slower? No. Thanks to the CakePHP ORM, we came up with an efficient method to write test fixtures on the fly: the CakePHP Fixture Factories. Tests are fast to write and document ideally your application. The package drastically increases the tests’ speed by offering the possibility to create entities without persistence.

On the journey we developed a trigger-based PHPUnit test listener in order to refresh test databases prior to each test.

Whether you are a CakePHP developer or not, the presentation will provide insights on how to arrange your tests and manage your test fixtures.

Juan Pablo Ramirez – Nicolas Masson
https://github.com/vierge-noire/cakephp-fixture-factories
https://github.com/vierge-noire/cakephp-test-suite-light

This Session originates from the archive of Diese Session stammt aus dem Archiv von BerlinBerlin . Take me to the program of . Hier geht es zum aktuellen Programm von Berlin Berlin .

This Session originates from the archive of Diese Session stammt aus dem Archiv von BerlinBerlin . Take me to the program of . Hier geht es zum aktuellen Programm von Munich München .

This Session Diese Session originates from the archive of stammt aus dem Archiv von BerlinBerlin . Take me to the current program of . Hier geht es zum aktuellen Programm von Berlin Berlin or oder Munich München .

Stay tuned!

Behind the Tracks of IPC

PHP Core & Coding
Best practices & applications

General Web Development
Broader web development topics

DevOps & Continuous Delivery
Learn about DevOps and transform your development pipeline

Software Architecture
All about PHP frameworks, concepts &
environments

Web Security
All about
web security

Software Quality
More about software testing tools &
strategies

Agile & Company Culture
Getting agile right is so important

Content Management Systems
Sessions on content management systems

#slideless (pure coding)
See how technology really works