1 | <?php |
||
10 | abstract class BaseTestCase extends \PHPUnit_Framework_TestCase |
||
11 | { |
||
12 | public static $params; |
||
13 | |||
14 | /** |
||
15 | * Clean up after test. |
||
16 | * By default the application created with [[mockApplication]] will be destroyed. |
||
17 | */ |
||
18 | protected function tearDown() |
||
23 | |||
24 | /** |
||
25 | * Returns a test configuration param from /data/config.php |
||
26 | * @param string $name params name |
||
27 | * @param mixed $default default value to use when param is not set. |
||
28 | * @return mixed the value of the configuration param |
||
29 | */ |
||
30 | public static function getParam($name, $default = null) |
||
38 | |||
39 | /** |
||
40 | * Populates Yii::$app with a new application |
||
41 | * The application will be destroyed on tearDown() automatically. |
||
42 | * @param array $config The application configuration, if needed |
||
43 | * @param string $appClass name of the application class to create |
||
44 | */ |
||
45 | protected function mockApplication($config = [], $appClass = '\yii\console\Application') |
||
53 | |||
54 | protected function mockWebApplication($config = [], $appClass = '\yii\web\Application') |
||
69 | |||
70 | protected function getVendorPath() |
||
78 | |||
79 | /** |
||
80 | * Destroys application in Yii::$app by setting it to null. |
||
81 | */ |
||
82 | protected function destroyApplication() |
||
89 | |||
90 | /** |
||
91 | * Asserting two strings equality ignoring line endings |
||
92 | * |
||
93 | * @param string $expected |
||
94 | * @param string $actual |
||
95 | */ |
||
96 | public function assertEqualsWithoutLE($expected, $actual) |
||
103 | } |
||
104 |