International PHP Conference
The Conference for PHP and Web Development

CakePHP Test Fixture Factories

Session
Until the conference starts:
✓ Arduino Starter Kit or Amazon Echo Dot for free
✓ Group discount
✓ 2 in 1 conference special
Register now
Bis Konferenz­beginn:
✓ Arduino Starter Kit oder Amazon Echo Dot gratis
✓ Kollegenrabatt
✓ 2-in-1-Konferenzpaket
Jetzt anmelden
Until July 14:
✓ Workshop Day for free
✓ Arduino or Echo Dot fo free
✓ Save up to 690€
Register now
Bis 14. Juli:
✓ Workshop Tag gratis
✓ Arduino oder Echo Dot for free
✓ Bis zu 690 € sparen
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
Best practices & applications

Web Development
Broader web development topics

Quality & Security
More about software quality &
security

Agile & People
Getting agile right is so important

Software Architecture
All about PHP frameworks, concepts &
environments

DevOps & Deployment
Learn about DevOps and transform your development pipeline

Content Management Systems
Sessions on content management systems

#slideless (pure coding)
See how technology really works

Web Security
All about
web security