1 | <?php |
||
9 | trait DbTestCaseTrait |
||
10 | { |
||
11 | /** |
||
12 | * @var null|Connection |
||
13 | */ |
||
14 | private $connection = null; |
||
15 | |||
16 | /** |
||
17 | * Performs operation returned by getSetUpOperation(). |
||
18 | */ |
||
19 | protected function setUp(): void |
||
26 | |||
27 | /** |
||
28 | * Performs operation returned by getTearDownOperation(). |
||
29 | */ |
||
30 | protected function tearDown(): void |
||
35 | |||
36 | abstract public function recreateDbScheme(); |
||
37 | |||
38 | public function assertCompareDataSet(array $tables, $expectedDataSetArrayFile, $message = '') |
||
53 | |||
54 | /** |
||
55 | * Returns fresh test database connection. |
||
56 | * |
||
57 | * @return PDO |
||
58 | */ |
||
59 | abstract protected function getPdoConnection(); |
||
60 | |||
61 | private function getConnection(): Connection |
||
69 | |||
70 | /** |
||
71 | * Returns the initial test dataset. |
||
72 | * |
||
73 | * @return ArrayDataSource |
||
74 | */ |
||
75 | abstract protected function getDataSet(); |
||
76 | |||
77 | /** |
||
78 | * @param array $data |
||
79 | * |
||
80 | * @return ArrayDataSource |
||
81 | */ |
||
82 | protected function createArrayDataSet(array $data) |
||
86 | } |
||
87 |