Skip to content

Commit 81382da

Browse files
authored
Merge pull request #38 from josegonzalez/josegonzalez-patch-1
feat: lower the php version
2 parents a46e973 + 92cf85a commit 81382da

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
language: php
22

33
php:
4+
- 5.5
5+
- 5.6
46
- 7.0
57
- 7.1
68
- hhvm

README.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ A `.env` file parsing and loading library for PHP.
1313

1414
## Requirements
1515

16-
* PHP 7.0+
16+
* PHP 5.5+
1717

1818
## Installation
1919

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
}
1515
],
1616
"require": {
17-
"php": ">=7.0.0",
17+
"php": ">=5.5.0",
1818
"m1/env": "2.*"
1919
},
2020
"require-dev": {

tests/josegonzalez/Dotenv/LoaderTest.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,11 +546,15 @@ public function testExpectRuntimeException()
546546

547547
/**
548548
* @covers \josegonzalez\Dotenv\Loader::apacheSetenv
549-
* @expectedException Error
550-
* @expectedExceptionMessage Call to undefined function josegonzalez\Dotenv\apache_getenv()
551549
*/
552550
public function testToApacheSetenvExceptionUnavailable()
553551
{
552+
if (version_compare(PHP_VERSION, '7.0', '<')) {
553+
$this->markTestSkipped('Unable to mock bare php functions');
554+
}
555+
556+
$this->expectException(\Error::class);
557+
$this->expectExceptionMessage('Call to undefined function josegonzalez\Dotenv\apache_getenv()');
554558
$this->Loader->parse();
555559
$this->Loader->apacheSetenv(false);
556560
}
@@ -560,6 +564,10 @@ public function testToApacheSetenvExceptionUnavailable()
560564
*/
561565
public function testToApacheSetenv()
562566
{
567+
if (version_compare(PHP_VERSION, '7.0', '<')) {
568+
$this->markTestSkipped('Unable to mock bare php functions');
569+
}
570+
563571
$apacheGetenv = $this->getFunctionMock(__NAMESPACE__, 'apache_getenv');
564572
$apacheGetenv->expects($this->any())->willReturnCallback(
565573
function ($key) {
@@ -591,6 +599,10 @@ function ($key, $value) {
591599
*/
592600
public function testToApacheSetenvSkip()
593601
{
602+
if (version_compare(PHP_VERSION, '7.0', '<')) {
603+
$this->markTestSkipped('Unable to mock bare php functions');
604+
}
605+
594606
$apacheGetenv = $this->getFunctionMock(__NAMESPACE__, 'apache_getenv');
595607
$apacheGetenv->expects($this->any())->willReturnCallback(
596608
function ($key) {
@@ -626,6 +638,10 @@ function ($key, $value) {
626638
*/
627639
public function testToApacheSetenvException()
628640
{
641+
if (version_compare(PHP_VERSION, '7.0', '<')) {
642+
$this->markTestSkipped('Unable to mock bare php functions');
643+
}
644+
629645
$apacheGetenv = $this->getFunctionMock(__NAMESPACE__, 'apache_getenv');
630646
$apacheGetenv->expects($this->any())->willReturnCallback(
631647
function ($key) {

0 commit comments

Comments
 (0)