Skip to content

Commit

Permalink
Merge branch '2.next' of github.com:CakeDC/Enum into 2.next
Browse files Browse the repository at this point in the history
  • Loading branch information
skie committed Apr 4, 2021
2 parents 95c16f4 + 3373559 commit 83bf628
Show file tree
Hide file tree
Showing 18 changed files with 41 additions and 7 deletions.
19 changes: 15 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
language: php

dist: xenial

php:
- 7.2
- 7.3

sudo: false

services:
- postgresql
- mysql

cache:
directories:
- vendor
- $HOME/.composer/cache

env:
matrix:
- DB=mysql db_dsn='mysql://root@127.0.0.1/cakephp_test'
- DB=mysql db_dsn='mysql://root@127.0.0.1/cakephp_test?init[]=SET sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"'
- DB=pgsql db_dsn='postgres://postgres@127.0.0.1/cakephp_test'
- DB=sqlite db_dsn='sqlite:///:memory:'

Expand All @@ -31,10 +42,10 @@ matrix:
before_script:
- if [[ $TRAVIS_PHP_VERSION != 7.3 ]]; then phpenv config-rm xdebug.ini; fi
- composer install --prefer-dist --no-interaction
- if [ $DB = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi
- if [ $DB = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi
- if [[ $DB == 'mysql' ]]; then mysql -u root -e 'CREATE DATABASE cakephp_test;'; fi
- if [[ $DB == 'pgsql' ]]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi
- if [[ $PHPSTAN = 1 ]]; then composer stan-setup; fi

script:
- if [[ $DEFAULT = 1 ]]; then composer test; fi
- if [[ $COVERAGE = 1 ]]; then composer coverage-test; fi
Expand Down
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"cakephp/cakephp": "^4.0"
},
"require-dev": {
"phpunit/phpunit": "^8.0",
"phpunit/phpunit": "^8.5",
"vlucas/phpdotenv": "^3.3",
"cakephp/cakephp-codesniffer": "^4.0"
},
Expand All @@ -35,10 +35,14 @@
"prefer-stable": true,
"minimum-stability": "dev",
"scripts": {
"analyse": [
"@stan",
"@psalm"
],
"check": [
"@cs-check",
"@test",
"@stan"
"@analyse"
],
"cs-check": "phpcs -p --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
"cs-fix": "phpcbf --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
Expand Down
1 change: 1 addition & 0 deletions src/Model/Behavior/EnumBehavior.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
declare(strict_types=1);

/**
* Copyright 2015 - 2019, Cake Development Corporation (http://cakedc.com)
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
declare(strict_types=1);

/**
* Copyright 2015 - 2019, Cake Development Corporation (http://cakedc.com)
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
declare(strict_types=1);

/**
* Copyright 2015 - 2019, Cake Development Corporation (http://cakedc.com)
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
declare(strict_types=1);

/**
* Copyright 2015 - 2019, Cake Development Corporation (http://cakedc.com)
*
Expand Down
1 change: 1 addition & 0 deletions src/Model/Behavior/Strategy/AbstractStrategy.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
declare(strict_types=1);

/**
* Copyright 2015 - 2019, Cake Development Corporation (http://cakedc.com)
*
Expand Down
1 change: 1 addition & 0 deletions src/Model/Behavior/Strategy/ConfigStrategy.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
declare(strict_types=1);

/**
* Copyright 2015 - 2019, Cake Development Corporation (http://cakedc.com)
*
Expand Down
1 change: 1 addition & 0 deletions src/Model/Behavior/Strategy/ConstStrategy.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
declare(strict_types=1);

/**
* Copyright 2015 - 2019, Cake Development Corporation (http://cakedc.com)
*
Expand Down
1 change: 1 addition & 0 deletions src/Model/Behavior/Strategy/LookupStrategy.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
declare(strict_types=1);

/**
* Copyright 2015 - 2019, Cake Development Corporation (http://cakedc.com)
*
Expand Down
1 change: 1 addition & 0 deletions src/Model/Behavior/Strategy/StrategyInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
declare(strict_types=1);

/**
* Copyright 2015 - 2019, Cake Development Corporation (http://cakedc.com)
*
Expand Down
1 change: 1 addition & 0 deletions src/Model/Table/LookupsTable.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
declare(strict_types=1);

/**
* Copyright 2015 - 2019, Cake Development Corporation (http://cakedc.com)
*
Expand Down
1 change: 1 addition & 0 deletions src/Plugin.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
declare(strict_types=1);

/**
* Copyright 2015 - 2019, Cake Development Corporation (http://cakedc.com)
*
Expand Down
3 changes: 3 additions & 0 deletions tests/TestCase/Model/Behavior/EnumBehaviorTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
declare(strict_types=1);

/**
* Copyright 2015 - 2019, Cake Development Corporation (http://cakedc.com)
*
Expand All @@ -18,6 +19,7 @@
use Cake\TestSuite\TestCase;
use CakeDC\Enum\Model\Behavior\Strategy\AbstractStrategy;

// @codingStandardsIgnoreStart
class ArticlesTable extends Table
{
public const STATUS_PUBLIC = 'Published';
Expand Down Expand Up @@ -59,6 +61,7 @@ public function enum(array $config = []): array
}

class EnumBehaviorTest extends TestCase
// @codingStandardsIgnoreEnd
{
public $fixtures = [
'plugin.CakeDC/Enum.Articles',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
declare(strict_types=1);

/**
* Copyright 2015 - 2019, Cake Development Corporation (http://cakedc.com)
*
Expand Down
4 changes: 3 additions & 1 deletion tests/TestCase/Model/Behavior/Strategy/ConstStrategyTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
declare(strict_types=1);

/**
* Copyright 2015 - 2019, Cake Development Corporation (http://cakedc.com)
*
Expand All @@ -17,6 +18,7 @@
use Cake\TestSuite\TestCase;
use CakeDC\Enum\Model\Behavior\Strategy\ConstStrategy;

// @codingStandardsIgnoreStart
class ArticlesTable extends Table
{
public const EXTRA_VALUE = 'Extra';
Expand All @@ -34,8 +36,8 @@ class Article extends Entity
public const STATUS_DRAFT = 'Drafted';
public const STATUS_ARCHIVE = 'Archived';
}

class ConstStrategyTest extends TestCase
// @codingStandardsIgnoreEnd
{
public $StrategyTable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
declare(strict_types=1);

/**
* Copyright 2015 - 2019, Cake Development Corporation (http://cakedc.com)
*
Expand Down
1 change: 1 addition & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
declare(strict_types=1);

/**
* Copyright 2015 - 2019, Cake Development Corporation (http://cakedc.com)
*
Expand Down

0 comments on commit 83bf628

Please sign in to comment.