elliotchance / elliotchance/concise
fakedb for mocking SQL databases
- Dominant language
- PHP
- Stars
- 45
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
This could be a layer on top of mocking just for certain PDO objects or a separate daemon if needed.
``` php
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();
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.