Skip to content

Commit

Permalink
Merge pull request #4 from yii2mod/upgrade-carbon-package
Browse files Browse the repository at this point in the history
Upgrade carbon version
  • Loading branch information
Igor Chepurnoy authored Jun 13, 2019
2 parents a51fd03 + c1d3f96 commit 2d35266
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 30 deletions.
10 changes: 3 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
language: php

php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2

# faster builds on new travis setup not using sudo
sudo: false
Expand All @@ -17,10 +14,9 @@ cache:

install:
- travis_retry composer self-update && composer --version
- travis_retry composer global require "fxp/composer-asset-plugin:~1.1.1"
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- travis_retry composer install --prefer-dist --no-interaction

script:
- vendor/friendsofphp/php-cs-fixer/php-cs-fixer fix --dry-run --diff
- phpunit --verbose $PHPUNIT_FLAGS
- vendor/bin/phpunit --verbose
7 changes: 1 addition & 6 deletions PurifyBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
use yii\db\ActiveRecord;
use yii\helpers\HtmlPurifier;

/**
* Class PurifyBehavior
*
* @package yii2mod\behaviors
*/
class PurifyBehavior extends Behavior
{
/**
Expand All @@ -21,7 +16,7 @@ class PurifyBehavior extends Behavior
/**
* @var null The config to use for HtmlPurifier
*/
public $config = null;
public $config;

/**
* Declares event handlers for the [[owner]]'s events.
Expand Down
24 changes: 20 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,35 @@
},
{
"name": "Igor Chepurnoy",
"email": "igorzfort@gmail.com"
"email": "chepurnoi.igor@gmail.com"
}
],
"require": {
"yiisoft/yii2": ">=2.0.5",
"php": "^7.1.8",
"yiisoft/yii2": "~2.0.10",
"nesbot/carbon": "^2.16"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "~2.0"
"friendsofphp/php-cs-fixer": "~2.0",
"phpunit/phpunit": "^7.3"
},
"autoload": {
"psr-4": {
"yii2mod\\behaviors\\": ""
}
}
},
"scripts": {
"phpcs": "php-cs-fixer fix -v --diff --dry-run --allow-risky=yes;",
"phpunit": "phpunit --coverage-text",
"test": [
"@phpunit",
"@phpcs"
]
},
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
]
}
20 changes: 10 additions & 10 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit bootstrap="./tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailure="false">
<testsuites>
<testsuite name="Yii2mod Test Suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailure="false">
<testsuites>
<testsuite name="Yii2mod Test Suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
</phpunit>
3 changes: 2 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
/**
* This is the base class for all yii framework unit tests.
*/
class TestCase extends \PHPUnit_Framework_TestCase
class TestCase extends \PHPUnit\Framework\TestCase
{
protected function setUp()
{
parent::setUp();

$this->mockApplication();

$this->createRuntimeFolder();
Expand Down
4 changes: 2 additions & 2 deletions tests/data/PostModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ public function behaviors()
{
return [
'carbon' => [
'class' => CarbonBehavior::className(),
'class' => CarbonBehavior::class,
'attributes' => [
'createdAt',
],
],
'purify' => [
'class' => PurifyBehavior::className(),
'class' => PurifyBehavior::class,
'attributes' => ['title'],
'config' => [
'AutoFormat.Linkify' => true,
Expand Down

0 comments on commit 2d35266

Please sign in to comment.