1 | <?php |
||
2 | /** |
||
3 | * @link https://www.yiiframework.com/ |
||
4 | * @copyright Copyright (c) 2008 Yii Software LLC |
||
5 | * @license https://www.yiiframework.com/license/ |
||
6 | */ |
||
7 | |||
8 | namespace yii\test; |
||
9 | |||
10 | use yii\base\BaseObject; |
||
11 | use yii\db\Connection; |
||
12 | use yii\di\Instance; |
||
13 | |||
14 | /** |
||
15 | * DbFixture is the base class for DB-related fixtures. |
||
16 | * |
||
17 | * DbFixture provides the [[db]] connection to be used by DB fixtures. |
||
18 | * |
||
19 | * For more details and usage information on DbFixture, see the [guide article on fixtures](guide:test-fixtures). |
||
20 | * |
||
21 | * @author Qiang Xue <[email protected]> |
||
22 | * @since 2.0 |
||
23 | */ |
||
24 | abstract class DbFixture extends Fixture |
||
25 | { |
||
26 | /** |
||
27 | * @var Connection|array|string the DB connection object or the application component ID of the DB connection. |
||
28 | * After the DbFixture object is created, if you want to change this property, you should only assign it |
||
29 | * with a DB connection object. |
||
30 | * Starting from version 2.0.2, this can also be a configuration array for creating the object. |
||
31 | */ |
||
32 | public $db = 'db'; |
||
33 | |||
34 | |||
35 | /** |
||
36 | * {@inheritdoc} |
||
37 | */ |
||
38 | 29 | public function init() |
|
39 | { |
||
40 | 29 | parent::init(); |
|
41 | 29 | $this->db = Instance::ensure($this->db, BaseObject::className()); |
|
0 ignored issues
–
show
|
|||
42 | } |
||
43 | } |
||
44 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.