Skip to content

Commit 3fecea9

Browse files
authored
Merge tests from codeception/yii2-tests to this repo (#56)
1 parent aec2976 commit 3fecea9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1323
-18
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
/Robofile.php export-ignore
55
/*.md export-ignore
66
/*.yml export-ignore
7+
/tests export-ignore
8+
/.github export-ignore

.github/workflows/main.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,7 @@ jobs:
2727
- name: Install dependencies
2828
run: composer install --prefer-dist --no-progress --no-interaction --no-suggest
2929

30-
- name: Checkout Yii2
31-
uses: actions/checkout@v2
32-
with:
33-
repository: Codeception/yii2-tests
34-
path: framework-tests
35-
36-
- name: Install Yii2
37-
run: |
38-
composer require --no-update codeception/module-asserts
39-
composer require --no-update codeception/module-filesystem
40-
composer require --no-update codeception/codeception
41-
composer update --no-dev --prefer-dist --no-interaction
42-
working-directory: framework-tests
43-
4430
- name: Run test suite
4531
run: |
46-
php vendor/bin/codecept build -c framework-tests
47-
php vendor/bin/codecept run -c framework-tests
32+
php vendor/bin/codecept build
33+
php vendor/bin/codecept run

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/.idea/
22
/vendor/
33
/composer.lock
4-
/framework-tests
4+
tests/_support
5+
tests/_output
6+
tests/cases/yii2-app-advanced/_data/db.sqlite

codeception.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
paths:
2+
tests: tests
3+
output: tests/_output
4+
data: tests/_data
5+
support: tests/_support
6+
envs: tests/_envs
7+
modules:
8+
- Asserts
9+
bootstrap: bootstrap.php
10+
settings:
11+
colors: true
12+
memory_limit: 1024M
13+
include:
14+
- tests/cases/*

composer.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,30 @@
2222
"codeception/lib-innerbrowser": "^1.0",
2323
"codeception/codeception": "^4.0"
2424
},
25+
"require-dev": {
26+
"yiisoft/yii2": "dev-master",
27+
"yiisoft/yii2-app-advanced": "dev-master",
28+
"codeception/verify": "<2",
29+
"codemix/yii2-localeurls": "^1.7",
30+
"codeception/module-asserts": "^1.3",
31+
"codeception/module-filesystem": "^1.0"
32+
},
2533
"autoload":{
2634
"classmap": ["src/"]
2735
},
36+
"autoload-dev": {
37+
"classmap": [
38+
"vendor/yiisoft/yii2/Yii.php",
39+
"tests/cases"
40+
]
41+
},
2842
"config": {
2943
"classmap-authoritative": true
30-
}
44+
},
45+
"repositories": [
46+
{
47+
"type": "composer",
48+
"url": "https://asset-packagist.org"
49+
}
50+
]
3151
}

tests/_data/.gitkeep

Whitespace-only changes.

tests/bootstrap.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
defined('YII_DEBUG') || define('YII_DEBUG', true);
3+
defined('YII_ENV') || define('YII_ENV', 'test');
4+
5+
Yii::$container = new \yii\di\Container();
6+
7+
$link = __DIR__ . '/../vendor/yiisoft/yii2-app-advanced/vendor';
8+
if (!file_exists($link) && !symlink(__DIR__ . '/../vendor', $link)) {
9+
die('failed to create symlink');
10+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
paths:
2+
tests: .
3+
log: ../../_output
4+
data: _data
5+
support: ../../_support
6+
namespace: tests\
7+
modules:
8+
config:
9+
Yii2:
10+
configFile: config.php
11+
transaction: false
12+
cleanup: true
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
return [
3+
'id' => 'Simple',
4+
'basePath' => __DIR__,
5+
6+
'components' => [
7+
'db' => [
8+
'class' => yii\db\Connection::class,
9+
'dsn' => 'sqlite:' . \tests\helpers\SqlliteHelper::getTmpFile(),
10+
],
11+
],
12+
];
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace tests\fixtures;
4+
5+
use yii\test\DbFixture;
6+
7+
class EmptyFixture extends DbFixture
8+
{
9+
public function load()
10+
{
11+
}
12+
13+
public function unload()
14+
{
15+
}
16+
}

0 commit comments

Comments
 (0)