Skip to content

Commit 97fee0d

Browse files
author
Norbert Orzechowicz
committed
Merge pull request #9 from norzechowicz/test-lowest-dependencies
Test lowest version of dependencies
2 parents d979178 + 7ca2074 commit 97fee0d

File tree

6 files changed

+58
-15
lines changed

6 files changed

+58
-15
lines changed

.travis.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
language: php
22

3-
php:
4-
- 5.3
5-
- 5.4
6-
- 5.5
3+
matrix:
4+
include:
5+
- php: 5.3
6+
env: DEPENDENCIES='low'
7+
- php: 5.3
8+
- php: 5.4
9+
- php: 5.5
10+
- php: 5.6
11+
- php: hhvm
12+
allow_failures:
13+
- env: DEPENDENCIES='low'
14+
15+
before_install:
16+
- composer self-update
17+
18+
install:
19+
- export COMPOSER_ROOT_VERSION=dev-master
20+
- if [ "$DEPENDENCIES" != "low" ]; then composer update; fi;
21+
- if [ "$DEPENDENCIES" == "low" ]; then composer update --prefer-lowest; fi;
722

823
script:
9-
- composer self-update
10-
- composer update -n --prefer-source
11-
- ./bin/phpspec run -f progress
24+
- ./bin/phpspec run --format=pretty

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#PHP Humanizer
22

33
[![Build Status](https://travis-ci.org/coduo/php-humanizer.svg?branch=master)](https://travis-ci.org/coduo/php-humanizer)
4-
[![Total Downloads](https://poser.pugx.org/coduo/php-humanizer/downloads.svg)](https://packagist.org/packages/coduo/php-humanizer)
5-
4+
[![Latest Stable Version](https://poser.pugx.org/coduo/php-humanizer/v/stable)](https://packagist.org/packages/coduo/php-humanizer)
5+
[![Total Downloads](https://poser.pugx.org/coduo/php-humanizer/downloads)](https://packagist.org/packages/coduo/php-humanizer)
6+
[![Latest Unstable Version](https://poser.pugx.org/coduo/php-humanizer/v/unstable)](https://packagist.org/packages/coduo/php-humanizer)
7+
[![License](https://poser.pugx.org/coduo/php-humanizer/license)](https://packagist.org/packages/coduo/php-humanizer)
68

79
Humanize values to make them readable for regular people ;)
810

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
"extra": {
3333
"branch-alias": {
34-
"dev-master": "1.0-dev"
34+
"dev-master": "1.1-dev"
3535
}
3636
}
3737
}

spec/Coduo/PHPHumanizer/DateTimeSpec.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,21 @@ function it_humanizes_precise_difference_between_dates()
8282
}
8383
}
8484

85+
function it_humanizes_precise_difference_between_dates_for_pl_locale()
86+
{
87+
$examples = array(
88+
array("2014-04-26 13:00:00", "2014-04-26 12:58:15", '1 minuta, 45 sekund temu'),
89+
array("2014-04-26 13:00:00", "2014-04-26 11:20:00", '1 godzina, 40 minut temu'),
90+
array("2014-04-26 13:00:00", "2014-04-27 13:15:00", '1 dzień, 15 minut od teraz'),
91+
array("2014-04-26 13:00:00", "2014-05-03 15:00:00", '7 dni, 2 godziny od teraz'),
92+
array("2014-04-26 13:00:00", "2015-04-28 17:00:00", '1 rok, 2 dni, 4 godziny od teraz'),
93+
array("2014-04-26 13:00:00", "2014-04-28 23:00:00", '2 dni, 10 godzin od teraz'),
94+
array("2014-04-26 13:00:00", "2014-04-25 11:20:00", '1 dzień, 1 godzina, 40 minut temu'),
95+
array("2014-04-26 13:00:00", "2016-04-27 13:00:00", '2 lata, 1 dzień od teraz'),
96+
);
97+
98+
foreach ($examples as $example) {
99+
$this->preciseDifference(new \DateTime($example[0]), new \DateTime($example[1]), 'pl')->shouldReturn($example[2]);
100+
}
101+
}
85102
}

src/Coduo/PHPHumanizer/Resources/translations/difference.en.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
just_now:
2-
past: "just now"
3-
future: "just now"
2+
past: "[0,Inf] just now"
3+
future: "[0,Inf] just now"
44
second:
55
past: "{1} %count% second ago|[2,Inf] %count% seconds ago"
66
future: "{1} %count% second from now|[2,Inf] %count% seconds from now"

src/Coduo/PHPHumanizer/Resources/translations/difference.pl.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
just_now:
2-
past: "w tym momencie"
3-
future: "w tym momencie"
2+
past: "[0,Inf] w tym momencie"
3+
future: "[0,Inf] w tym momencie"
44
second:
55
past: "{1} sekundę temu|[2, 4] %count% sekundy temu|[5,Inf] %count% sekund temu"
66
future: "{1} za sekundę|[2, 4] za %count% sekund|[5,Inf] za %count% sekund"
@@ -21,4 +21,15 @@ month:
2121
future: "{1} za miesiąc|[2, 4] za %count% miesiące|[5,Inf] za %count% miesięcy"
2222
year:
2323
past: "{1} rok temu|[2, 4] %count% lata temu|[5,Inf] %count% lat temu"
24-
future: "{1} za rok|[2, 4] za %count% lata|[5,Inf] za %count% lat"
24+
future: "{1} za rok|[2, 4] za %count% lata|[5,Inf] za %count% lat"
25+
26+
compound:
27+
second: "{1} %count% sekunda|[2,4] %count% sekundy|[5,Inf] %count% sekund"
28+
minute: "{1} %count% minuta|[2,4] %count% minuty|[5,Inf] %count% minut"
29+
hour: "{1} %count% godzina|[2,4] %count% godziny|[5,Inf] %count% godzin"
30+
day: "{1} %count% dzień|[2,Inf] %count% dni"
31+
week: "{1} %count% tydzień|[2,4] %count% tygodnie|[5,Inf] %count% tygodni"
32+
month: "{1} %count% miesiąc|[2,4] %count% miesiące|[5,Inf] %count% miesięcy"
33+
year: "{1} %count% rok|[2,4] %count% lata|[5,Inf] %count% lat"
34+
ago: "temu"
35+
from_now: "od teraz"

0 commit comments

Comments
 (0)