File tree Expand file tree Collapse file tree 6 files changed +38
-30
lines changed Expand file tree Collapse file tree 6 files changed +38
-30
lines changed Original file line number Diff line number Diff line change 1
1
language : php
2
-
3
2
php :
4
- - 5.4
5
- - 5.5
6
- - 5.6
7
- - 7.0
3
+ - 7.1
4
+ - 7.2
8
5
9
6
# faster builds on new travis setup not using sudo
10
7
sudo : false
@@ -17,10 +14,9 @@ cache:
17
14
18
15
install :
19
16
- travis_retry composer self-update && composer --version
20
- - travis_retry composer global require "fxp/composer-asset-plugin:~1.1.1"
21
17
- export PATH="$HOME/.composer/vendor/bin:$PATH"
22
18
- travis_retry composer install --prefer-dist --no-interaction
23
19
24
20
script :
25
21
- vendor/friendsofphp/php-cs-fixer/php-cs-fixer fix --dry-run --diff
26
- - phpunit --verbose $PHPUNIT_FLAGS
22
+ - vendor/bin/ phpunit --verbose
Original file line number Diff line number Diff line change 6
6
use yii \db \ActiveRecord ;
7
7
use yii \helpers \HtmlPurifier ;
8
8
9
- /**
10
- * Class PurifyBehavior
11
- *
12
- * @package yii2mod\behaviors
13
- */
14
9
class PurifyBehavior extends Behavior
15
10
{
16
11
/**
@@ -21,7 +16,7 @@ class PurifyBehavior extends Behavior
21
16
/**
22
17
* @var null The config to use for HtmlPurifier
23
18
*/
24
- public $ config = null ;
19
+ public $ config ;
25
20
26
21
/**
27
22
* Declares event handlers for the [[owner]]'s events.
Original file line number Diff line number Diff line change 14
14
},
15
15
{
16
16
"name" : " Igor Chepurnoy" ,
17
- "email" : " igorzfort @gmail.com"
17
+ "email" : " chepurnoi.igor @gmail.com"
18
18
}
19
19
],
20
20
"require" : {
21
- "yiisoft/yii2" : " >=2.0.5" ,
21
+ "php" : " ^7.1.8" ,
22
+ "yiisoft/yii2" : " ~2.0.10" ,
22
23
"nesbot/carbon" : " ^2.16"
23
24
},
24
25
"require-dev" : {
25
- "friendsofphp/php-cs-fixer" : " ~2.0"
26
+ "friendsofphp/php-cs-fixer" : " ~2.0" ,
27
+ "phpunit/phpunit" : " ^7.3"
26
28
},
27
29
"autoload" : {
28
30
"psr-4" : {
29
31
"yii2mod\\ behaviors\\ " : " "
30
32
}
31
- }
33
+ },
34
+ "scripts" : {
35
+ "phpcs" : " php-cs-fixer fix -v --diff --dry-run --allow-risky=yes;" ,
36
+ "phpunit" : " phpunit --coverage-text" ,
37
+ "test" : [
38
+ " @phpunit" ,
39
+ " @phpcs"
40
+ ]
41
+ },
42
+ "repositories" : [
43
+ {
44
+ "type" : " composer" ,
45
+ "url" : " https://asset-packagist.org"
46
+ }
47
+ ]
32
48
}
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" utf-8" ?>
2
2
<phpunit bootstrap =" ./tests/bootstrap.php"
3
- colors=" true"
4
- convertErrorsToExceptions=" true"
5
- convertNoticesToExceptions=" true"
6
- convertWarningsToExceptions=" true"
7
- stopOnFailure=" false" >
8
- <testsuites >
9
- <testsuite name =" Yii2mod Test Suite" >
10
- <directory >./tests</directory >
11
- </testsuite >
12
- </testsuites >
3
+ colors =" true"
4
+ convertErrorsToExceptions =" true"
5
+ convertNoticesToExceptions =" true"
6
+ convertWarningsToExceptions =" true"
7
+ stopOnFailure =" false" >
8
+ <testsuites >
9
+ <testsuite name =" Yii2mod Test Suite" >
10
+ <directory >./tests</directory >
11
+ </testsuite >
12
+ </testsuites >
13
13
</phpunit >
Original file line number Diff line number Diff line change 9
9
/**
10
10
* This is the base class for all yii framework unit tests.
11
11
*/
12
- class TestCase extends \PHPUnit_Framework_TestCase
12
+ class TestCase extends \PHPUnit \ Framework \TestCase
13
13
{
14
14
protected function setUp ()
15
15
{
16
16
parent ::setUp ();
17
+
17
18
$ this ->mockApplication ();
18
19
19
20
$ this ->createRuntimeFolder ();
Original file line number Diff line number Diff line change @@ -38,13 +38,13 @@ public function behaviors()
38
38
{
39
39
return [
40
40
'carbon ' => [
41
- 'class ' => CarbonBehavior::className () ,
41
+ 'class ' => CarbonBehavior::class ,
42
42
'attributes ' => [
43
43
'createdAt ' ,
44
44
],
45
45
],
46
46
'purify ' => [
47
- 'class ' => PurifyBehavior::className () ,
47
+ 'class ' => PurifyBehavior::class ,
48
48
'attributes ' => ['title ' ],
49
49
'config ' => [
50
50
'AutoFormat.Linkify ' => true ,
You can’t perform that action at this time.
0 commit comments