By Sebastian Bergman and Arne Blankerts.
Keep your eyes up and stay tuned for "patch coverage".
Second time, thanks for the book - handed over by sebastian himself. Mister HowTrueIsFalse, you will get back your book soon :-).
What Is The Talk About
Integration tests closing the gap between unit tests and system tests. This is resolved by keep the focus on interfaces between components and testing that the interaction between the components is working as expected.
Arne Blankerts and Sebastian Bergman showing how a problem by setting up the integration tests became a feature aka "Test Proxies" for PHPUnit.
They also discuss problems and provide solutions for implementing mock objects in php unit and how to ship them as features.
How To Visualize
How lower you go, the faster and the exact the tested code behaves. How higher you go, the more you can provide a stable and general testcase.
Isolation, speed (top down) vs Confidence in whole system (bottom up) from how google tests software
Test one unit is a unit test.
Write a test between two units is more a integration test than a unit test. Current idea is to stub or mock one of the two units and see how other unit acts.
Push the idea of stubbing and mocking more to the edge will lead to "edge to edge test" like "client to server test". In general, try to test components on the same level (layer).
Try to monitor systems for load tests and use appdynamcis or xdebug and xhprof.
public function __construct(Backend $backend, Service $service)
$this->backend = $backend;
$this->service = $service;
public function execute(Request $request)
How to test this?
Would be cool if we can log that code was executed like test proxies by adding an extra flag to the mock builder.
Provides way to see where dataflow changed or drifts from expected way (will be in PHPUnit 3.8).
class SampleWorkflowTest extends PHPUnit_Framework_TestCase
public function testServiceCallUpdatesObjects()
$service = $this->getMockBuilder('Service')
$backend = new Backend();
$workflow = new SampleWorkflow($backend, $service);
$workflow->execute(new Request(array('id' => 42)));