Skip to content

Commit

Permalink
Merge pull request #38 from josegonzalez/josegonzalez-patch-1
Browse files Browse the repository at this point in the history
feat: lower the php version
  • Loading branch information
josegonzalez committed Jul 14, 2017
2 parents a46e973 + 92cf85a commit 81382da
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
@@ -1,6 +1,8 @@
language: php

php:
- 5.5
- 5.6
- 7.0
- 7.1
- hhvm
Expand Down
2 changes: 1 addition & 1 deletion README.markdown
Expand Up @@ -13,7 +13,7 @@ A `.env` file parsing and loading library for PHP.

## Requirements

* PHP 7.0+
* PHP 5.5+

## Installation

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -14,7 +14,7 @@
}
],
"require": {
"php": ">=7.0.0",
"php": ">=5.5.0",
"m1/env": "2.*"
},
"require-dev": {
Expand Down
20 changes: 18 additions & 2 deletions tests/josegonzalez/Dotenv/LoaderTest.php
Expand Up @@ -546,11 +546,15 @@ public function testExpectRuntimeException()

/**
* @covers \josegonzalez\Dotenv\Loader::apacheSetenv
* @expectedException Error
* @expectedExceptionMessage Call to undefined function josegonzalez\Dotenv\apache_getenv()
*/
public function testToApacheSetenvExceptionUnavailable()
{
if (version_compare(PHP_VERSION, '7.0', '<')) {
$this->markTestSkipped('Unable to mock bare php functions');
}

$this->expectException(\Error::class);
$this->expectExceptionMessage('Call to undefined function josegonzalez\Dotenv\apache_getenv()');
$this->Loader->parse();
$this->Loader->apacheSetenv(false);
}
Expand All @@ -560,6 +564,10 @@ public function testToApacheSetenvExceptionUnavailable()
*/
public function testToApacheSetenv()
{
if (version_compare(PHP_VERSION, '7.0', '<')) {
$this->markTestSkipped('Unable to mock bare php functions');
}

$apacheGetenv = $this->getFunctionMock(__NAMESPACE__, 'apache_getenv');
$apacheGetenv->expects($this->any())->willReturnCallback(
function ($key) {
Expand Down Expand Up @@ -591,6 +599,10 @@ function ($key, $value) {
*/
public function testToApacheSetenvSkip()
{
if (version_compare(PHP_VERSION, '7.0', '<')) {
$this->markTestSkipped('Unable to mock bare php functions');
}

$apacheGetenv = $this->getFunctionMock(__NAMESPACE__, 'apache_getenv');
$apacheGetenv->expects($this->any())->willReturnCallback(
function ($key) {
Expand Down Expand Up @@ -626,6 +638,10 @@ function ($key, $value) {
*/
public function testToApacheSetenvException()
{
if (version_compare(PHP_VERSION, '7.0', '<')) {
$this->markTestSkipped('Unable to mock bare php functions');
}

$apacheGetenv = $this->getFunctionMock(__NAMESPACE__, 'apache_getenv');
$apacheGetenv->expects($this->any())->willReturnCallback(
function ($key) {
Expand Down

0 comments on commit 81382da

Please sign in to comment.