1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
namespace Codeception\Lib\Interfaces;
interface Db
{
/**
* Asserts that a row with the given column values exists.
* Provide table name and column values.
*
* ```php
* <?php
* $I->seeInDatabase('users', ['name' => 'Davert', 'email' => 'davert@mail.com']);
* ```
* Fails if no such user found.
*
* Comparison expressions can be used as well:
*
* ```php
* <?php
* $I->seeInDatabase('posts', ['num_comments >=' => '0']);
* $I->seeInDatabase('users', ['email like' => 'miles@davis.com']);
* ```
*
* Supported operators: `<`, `>`, `>=`, `<=`, `!=`, `like`.
*
*
* @param string $table
* @param array $criteria
*/
public function seeInDatabase($table, $criteria = []);
/**
* Effect is opposite to ->seeInDatabase
*
* Asserts that there is no record with the given column values in a database.
* Provide table name and column values.
*
* ``` php
* <?php
* $I->dontSeeInDatabase('users', ['name' => 'Davert', 'email' => 'davert@mail.com']);
* ```
* Fails if such user was found.
*
* Comparison expressions can be used as well:
*
* ```php
* <?php
* $I->dontSeeInDatabase('posts', ['num_comments >=' => '0']);
* $I->dontSeeInDatabase('users', ['email like' => 'miles%']);
* ```
*
* Supported operators: `<`, `>`, `>=`, `<=`, `!=`, `like`.
*
* @param string $table
* @param array $criteria
*/
public function dontSeeInDatabase($table, $criteria = []);
/**
* Fetches a single column value from a database.
* Provide table name, desired column and criteria.
*
* ``` php
* <?php
* $mail = $I->grabFromDatabase('users', 'email', array('name' => 'Davert'));
* ```
* Comparison expressions can be used as well:
*
* ```php
* <?php
* $post = $I->grabFromDatabase('posts', ['num_comments >=' => 100]);
* $user = $I->grabFromDatabase('users', ['email like' => 'miles%']);
* ```
*
* Supported operators: `<`, `>`, `>=`, `<=`, `!=`, `like`.
*
* @param string $table
* @param string $column
* @param array $criteria
*
* @return mixed
*/
public function grabFromDatabase($table, $column, $criteria = []);
}