Open elliotchance opened 8 years ago
This could be a layer on top of mocking just for certain PDO objects or a separate daemon if needed.
public function testFetchingAPerson() { $this->fakedb->stub( 'SELECT * FROM people WHERE id = 123', ['id' => 123, 'name' => 'John Smith'] ); $fetcher = new Person(); $this->assert($fetcher->get(123))->equals(['id' => 123, 'name' => 'John Smith']); } public function testAddingAPerson() { $this->fakedb->expectInsert('people', ['name' => 'John Smith']); $person = new Person(); $person->name = 'John Smith'; $person->save(); }
This could be a layer on top of mocking just for certain PDO objects or a separate daemon if needed.