Skip to content
Closed
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
6 changes: 3 additions & 3 deletions src/ZendPhpDotEnv/DotEnvLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static function loadFromConstant($constant, $file)
try {
return DotEnvFactory::createFromConstant($constant, $file)->load();
} catch (InvalidPathException $e) {
throw new InvalidConstantPathException($e->getMessage(), $e->getCode(), $e);
//
}
}

Expand All @@ -56,7 +56,7 @@ public static function loadFromEnvironmentVariable($variable, $file)
try {
return DotEnvFactory::createFromEnvironmentVariable($variable, $file)->load();
} catch (InvalidPathException $e) {
throw new InvalidEnvironmentVariablePathException($e->getMessage(), $e->getCode(), $e);
//
}
}

Expand All @@ -70,7 +70,7 @@ public static function loadFromWorkingDirectory($file)
try {
return DotEnvFactory::createFromWorkingDirectory($file)->load();
} catch (InvalidPathException $e) {
throw new InvalidWorkingDirectoryPathException($e->getMessage(), $e->getCode(), $e);
//
}
}
}
30 changes: 0 additions & 30 deletions tests/ZendPhpDotEnv/DotEnvLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,34 +33,4 @@ public function testHasEnvironmentVariable()

self::assertTrue($actual);
}

/**
* @expectedException \Abacaphiliac\ZendPhpDotEnv\Exception\InvalidConstantPathException
*/
public function testLoadEnvironmentVariablesFromConstant()
{
self::assertFalse(defined(__FUNCTION__));
define(__FUNCTION__, __DIR__);

DotEnvLoader::loadFromConstant(__FUNCTION__, '.testEnv');
}

/**
* @expectedException \Abacaphiliac\ZendPhpDotEnv\Exception\InvalidEnvironmentVariablePathException
*/
public function testLoadEnvironmentVariablesFromEnvironmentVariable()
{
self::assertFalse(DotEnvLoader::hasEnvironmentVariable(__FUNCTION__));
$_ENV[__FUNCTION__] = __DIR__;

DotEnvLoader::loadFromEnvironmentVariable(__FUNCTION__, '.testEnv');
}

/**
* @expectedException \Abacaphiliac\ZendPhpDotEnv\Exception\InvalidWorkingDirectoryPathException
*/
public function testLoadEnvironmentVariablesFromWorkingDirectory()
{
DotEnvLoader::loadFromWorkingDirectory($file = '.testEnv');
}
}
73 changes: 0 additions & 73 deletions tests/ZendPhpDotEnv/ModuleTest.php

This file was deleted.