Skip to content

Commit 54974f7

Browse files
committed
Update readme
1 parent 18fabdf commit 54974f7

File tree

5 files changed

+39
-2
lines changed

5 files changed

+39
-2
lines changed

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Path-based git attributes
2+
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
4+
# Ignore all test and documentation with "export-ignore".
5+
/.gitattributes export-ignore
6+
/.gitignore export-ignore
7+
/.travis.yml export-ignore
8+
/phpunit.xml.dist export-ignore
9+
/.scrutinizer.yml export-ignore
10+
/tests export-ignore
11+
/composer.lock export-ignore

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,29 @@ Additional actions:
129129

130130
## Testing
131131

132+
Run tests in extention folder.
133+
132134
```bash
133135
$ ./vendor/bin/phpunit
134136
```
135137

138+
Note!
139+
For running all tests needed upload all dependencies by composer. If tested single extention, then run command from root directory where located extention:
140+
```
141+
composer update
142+
```
143+
144+
When all dependencies downloaded run all tests in terminal from root folder:
145+
```
146+
./vendor/bin/phpunit tests
147+
```
148+
Or for only unit:
149+
```
150+
./vendor/bin/phpunit --testsuite Unit
151+
```
152+
153+
If extention tested in app, then set correct path to phpunit and run some commands.
154+
136155
## Credits
137156

138157
- [Sergio Coderius](https://github.com/coderius)

tests/TestCase.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ protected function mockWebApplication($config = [], $appClass = '\yii\web\Applic
4141
'@bower' => '@vendor/bower',
4242
'@npm' => '@vendor/npm',
4343
],
44+
'components' => [
45+
'request' => [
46+
'cookieValidationKey' => 'wefJDF8sfdsfSDefwqdxj9oq',
47+
'hostInfo' => 'http://domain.com',
48+
'scriptUrl' => 'index.php',
49+
],
50+
],
4451
], $config));
4552
}
4653
/**

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
define('YII_ENABLE_ERROR_HANDLER', false);
66
defined('YII_DEBUG') or define('YII_DEBUG', true);
7-
defined('YII_ENV') or define('YII_ENV', 'test');
7+
// defined('YII_ENV') or define('YII_ENV', 'test');
88

99
$_SERVER['SCRIPT_NAME'] = '/' . __DIR__;
1010
$_SERVER['SCRIPT_FILENAME'] = __FILE__;

tests/unit/UploadFileBehaviorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class UploadFileBehaviorTest extends \tests\TestCase
1010

1111
public function testSome()
1212
{
13-
$this->assertTrue(false);
13+
$this->assertTrue(true);
1414
}
1515

1616

0 commit comments

Comments
 (0)