1 | <?php |
||
13 | abstract class TestCase extends PHPUnit_Framework_TestCase |
||
14 | { |
||
15 | /** |
||
16 | * Mock Yii application. |
||
17 | */ |
||
18 | protected function setUp() |
||
23 | |||
24 | /** |
||
25 | * Clean up after test. |
||
26 | * By default the application created with `mockApplication` will be destroyed. |
||
27 | */ |
||
28 | protected function tearDown() |
||
33 | |||
34 | /** |
||
35 | * Populates Yii::$app with a new application. |
||
36 | * The application will be destroyed on tearDown() automatically. |
||
37 | * @param array $config the application configuration, if needed |
||
38 | * @param string $appClass name of the application class to create |
||
39 | */ |
||
40 | protected static function mockApplication($config = [], $appClass = 'yii\console\Application') |
||
53 | |||
54 | /** |
||
55 | * Get path to "vendor" directory. |
||
56 | * @return string path to "vendor" directory. |
||
57 | */ |
||
58 | protected static function getVendorPath() |
||
62 | |||
63 | /** |
||
64 | * Destroys application in Yii::$app by setting it to null. |
||
65 | */ |
||
66 | protected static function destroyApplication() |
||
70 | |||
71 | /** |
||
72 | * Add column to array. |
||
73 | * @param array $array |
||
74 | * @param mixed $value |
||
75 | * @return array |
||
76 | */ |
||
77 | protected static function arrayAddColumn($array, $value) |
||
87 | |||
88 | /** |
||
89 | * \u escape sequence for PHP. |
||
90 | * @param string $text |
||
91 | * @return string |
||
92 | */ |
||
93 | protected static function u($text) |
||
97 | } |
||
98 |