Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the minimum supported PHP version from 5.5 to 7.2 #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
/php-cs-fixer.phar
/vendor/
cache.properties
.php_cs.cache
.phpunit.result.cache
12 changes: 8 additions & 4 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<?php
$finder = Symfony\CS\Finder\DefaultFinder::create()
$finder = PhpCsFixer\Finder::create()
->in(__DIR__.'/src')
->in(__DIR__.'/tests')
;

return Symfony\CS\Config\Config::create()
->fixers(array('-empty_return', '-blankline_after_open_tag', 'ordered_use', '-phpdoc_no_empty_return'))
->finder($finder)
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'blank_line_after_opening_tag' => true,
'phpdoc_no_empty_return' => true,
])
->setFinder($finder)
;
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@ cache:
- $HOME/.composer/cache

php:
- 5.5
- 5.6
- 7
- 7.1
- 7.2
- 7.3

matrix:
allow_failures:
- php: hhvm
fast_finish: true

before_script:
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
}
],
"require": {
"php": ">=5.5",
"php": ">=7.2",
"phpmentors/domain-kata": "~1.3"
},
"require-dev": {
"phpunit/phpunit": "~4.6"
"phpunit/phpunit": "~8.3"
},
"autoload": {
"psr-4": {
Expand Down
19 changes: 10 additions & 9 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<phpunit bootstrap="tests/bootstrap.php">
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
bootstrap="tests/bootstrap.php"
failOnRisky="true"
failOnWarning="true">
<testsuites>
<testsuite>
<testsuite name="Dommain Commons Test Suite">
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>

<logging>
<log type="coverage-html" target="build/coverage"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
</logging>

<php>
<ini name="error_reporting" value="-1" />
</php>
<filter>
<whitelist>
<directory suffix=".php">src</directory>
Expand Down
8 changes: 5 additions & 3 deletions tests/DateTime/AgeRangeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@

namespace PHPMentors\DomainCommons\DateTime;

use PHPUnit\Framework\TestCase;

/**
* @since Class available since Release 1.1.0
*/
class AgeRangeTest extends \PHPUnit_Framework_TestCase
class AgeRangeTest extends TestCase
{
/**
* @param string $target
Expand Down Expand Up @@ -47,7 +49,7 @@ public function getMaxAsDateData()
*/
public function getMaxAsDate(\DateTimeInterface $currentDate, $max, $maxAsDate)
{
$clock = $this->getMock('PHPMentors\DomainCommons\DateTime\Clock');
$clock = $this->createMock('PHPMentors\DomainCommons\DateTime\Clock');
$clock->method('now')->will($this->returnValue($currentDate));
$ageRange = new AgeRange();
$ageRange->setClock($clock);
Expand Down Expand Up @@ -76,7 +78,7 @@ public function getMinAsDateData()
*/
public function getMinAsDate(\DateTimeInterface $currentDate, $min, $minAsDate)
{
$clock = $this->getMock('PHPMentors\DomainCommons\DateTime\Clock');
$clock = $this->createMock('PHPMentors\DomainCommons\DateTime\Clock');
$clock->method('now')->will($this->returnValue($currentDate));
$ageRange = new AgeRange();
$ageRange->setClock($clock);
Expand Down
4 changes: 3 additions & 1 deletion tests/DateTime/DateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

namespace PHPMentors\DomainCommons\DateTime;

class DateTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class DateTest extends TestCase
{
/**
* @test
Expand Down
8 changes: 6 additions & 2 deletions tests/DateTime/DateTimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@

namespace PHPMentors\DomainCommons\DateTime;

class DateTimeTest extends \PHPUnit_Framework_TestCase
use PHPMentors\DomainCommons\DateTime\Exception\UnsupportedCalculation;
use PHPUnit\Framework\TestCase;

class DateTimeTest extends TestCase
{
/**
* @test
Expand Down Expand Up @@ -69,10 +72,11 @@ public function addMonthsData()
* @param string $dateStr
* @param int $months
* @dataProvider addMonthsThrowsExceptionData
* @expectedException \PHPMentors\DomainCommons\DateTime\Exception\UnsupportedCalculation
*/
public function addMonthsThrowsException($dateStr, $months)
{
$this->expectException(UnsupportedCalculation::class);

$date = new DateTime($dateStr);

$date->addMonths($months);
Expand Down
4 changes: 3 additions & 1 deletion tests/DateTime/HourMinTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

namespace PHPMentors\DomainCommons\DateTime;

class HourMinTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class HourMinTest extends TestCase
{
/**
* @test
Expand Down
4 changes: 3 additions & 1 deletion tests/DateTime/MonthDayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

namespace PHPMentors\DomainCommons\DateTime;

class MonthDayTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class MonthDayTest extends TestCase
{
/**
* @test
Expand Down
3 changes: 2 additions & 1 deletion tests/DateTime/PeriodTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

namespace PHPMentors\DomainCommons\DateTime;

use PHPUnit\Framework\TestCase;
use PHPMentors\DomainCommons\DateTime\Period\DailyIteratableInterface;
use PHPMentors\DomainCommons\DateTime\Period\DailyTrait;

Expand All @@ -26,7 +27,7 @@ public function __construct($start, $end)
}
}

class PeriodTraitTest extends \PHPUnit_Framework_TestCase
class PeriodTraitTest extends TestCase
{
/**
* @test
Expand Down
3 changes: 2 additions & 1 deletion tests/DateTime/ThreeMonthlyTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

namespace PHPMentors\DomainCommons\DateTime;

use PHPUnit\Framework\TestCase;
use PHPMentors\DomainCommons\DateTime\Period\MonthlyIteratableInterface;
use PHPMentors\DomainCommons\DateTime\Period\ThreeMonthlyTrait;

Expand All @@ -38,7 +39,7 @@ public function getStart(){return $this->start;}
public function getEnd(){return $this->end;}
}

class ThreeMonthlyTraitTest extends \PHPUnit_Framework_TestCase
class ThreeMonthlyTraitTest extends TestCase
{
/**
* @test
Expand Down
4 changes: 3 additions & 1 deletion tests/DateTime/YearMonthTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

namespace PHPMentors\DomainCommons\DateTime;

class YearMonthTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class YearMonthTest extends TestCase
{
/**
* @test
Expand Down
4 changes: 3 additions & 1 deletion tests/DateTime/YearTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

namespace PHPMentors\DomainCommons\DateTime;

class YearTest extends \PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;

class YearTest extends TestCase
{
/**
* @test
Expand Down
4 changes: 3 additions & 1 deletion tests/String/UniqueNameTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@

namespace PHPMentors\DomainCommons\String;

use PHPUnit\Framework\TestCase;

/**
* @since Class available since Release 1.1.1
*/
class UniqueNameTest extends \PHPUnit_Framework_TestCase
class UniqueNameTest extends TestCase
{
public function test()
{
Expand Down
3 changes: 1 addition & 2 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?php

/** @var $loader \Composer\Autoload\ClassLoader */
$loader = require dirname(__DIR__).'/vendor/autoload.php';
require dirname(__DIR__).'/vendor/autoload.php';