Skip to content
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
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
language: php

php:
- 5.3
- 5.4
- 7.1
- 7.2
- 7.3

before_script: composer install --dev
before_script: composer install

script:
- bin/phpunit
13 changes: 9 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
],
"license": "MIT",
"require": {
"php": ">=5.3.0"
"php": "^7.1"
},
"require-dev": {
"phpunit/phpunit": "~3.7"
"phpunit/phpunit": "^7.0"
},
"authors": [
{
Expand All @@ -23,8 +23,13 @@
}
],
"autoload": {
"psr-0": {
"": "src/"
"psr-4": {
"Elnur\\Era\\": "src/Elnur/Era/"
}
},
"autoload-dev": {
"psr-4": {
"Elnur\\Era\\": "test/Elnur/Era/"
}
},
"config": {
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
bootstrap="./vendor/autoload.php"
>
<testsuites>
<testsuite>
<testsuite name="era tests">
<directory>test</directory>
</testsuite>
</testsuites>
Expand Down
1 change: 0 additions & 1 deletion src/Elnur/Era/AgeCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
namespace Elnur\Era;

use DateTime;
use Elnur\Era\CalendarInterface;

class AgeCalculator implements AgeCalculatorInterface
{
Expand Down
6 changes: 3 additions & 3 deletions test/Elnur/Era/AgeCalculatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
namespace Elnur\Era;

use DateTime;
use PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase;

class AgeCalculatorTest extends PHPUnit_Framework_TestCase
class AgeCalculatorTest extends TestCase
{
public function testAge()
{
$now = new DateTime('2007-05-31');

$calendar = $this->getMockForAbstractClass('Elnur\Era\CalendarInterface');
$calendar = $this->getMockForAbstractClass(CalendarInterface::class);
$calendar
->expects($this->any())
->method('now')
Expand Down
10 changes: 7 additions & 3 deletions test/Elnur/Era/CalendarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@
namespace Elnur\Era;

use DateTime;
use PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase;

class CalendarTest extends PHPUnit_Framework_TestCase
class CalendarTest extends TestCase
{
public function testNow()
{
$dateFormat = 'Y-m-d H:m';
$calendar = new Calendar;
$this->assertEquals(new DateTime, $calendar->now());
$now = new DateTime;

$this->assertInstanceOf(DateTime::class, $calendar->now());
$this->assertEquals($now->format($dateFormat), $calendar->now()->format($dateFormat));
}
}