elliotchance / elliotchance/concise

fakedb for mocking SQL databases

Open
#291 0 comments 0 reactions 0 assignees View on GitHub
Component: Core Size: 3 (Large) Type: Feature
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.