Setup yii app in bootstrap

This commit is contained in:
Ade Attwood 2017-06-23 22:37:08 +01:00
parent 6350c747b6
commit aef387bab3
4 changed files with 46 additions and 0 deletions

View file

@ -5,6 +5,10 @@ paths:
support: tests/_support
envs: tests/_envs
actor_suffix: Tester
settings:
bootstrap: _bootstrap.php
memory_limit: 1024M
colors: true
extensions:
enabled:
- Codeception\Extension\RunFailed

View file

@ -14,6 +14,11 @@
"adeattwood\\helpers\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"adeattwood\\helpers\\tests\\": "tests"
}
},
"require": {
"yiisoft/yii2": "^2.0"
},

15
tests/_data/ModelOne.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace adeattwood\helpers\tests\_data;
class ModelOne extends \yii\base\Model
{
public $propOne;
public function rules()
{
return [
[ [ 'propOne' ], 'string' ]
];
}
}

22
tests/unit/_bootstrap.php Normal file
View file

@ -0,0 +1,22 @@
<?php
/**
* @category PHP
* @package adeattwood\yii-helpers
* @author Ade Attwood <attwood16@googlemail.com>
* @copyright 2017 adeattwood.co.uk
* @license BSD-2-Clause http://adeattwood.co.uk/license.html
* @link adeattwood.co.uk
* @since v0.1
*/
require __DIR__ . "/../../vendor/autoload.php";
require __DIR__ . "/../../vendor/yiisoft/yii2/Yii.php";
$config = [
'id' => 'Yii Helpers Tests',
'basePath' => dirname( __DIR__ )
];
( new yii\web\Application( $config ) );