-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move "Pimcore\BootstrapPimcore" to the namespace root
- Loading branch information
Showing
5 changed files
with
56 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Neusta\Pimcore\TestingFramework; | ||
|
||
use Neusta\Pimcore\TestingFramework\Pimcore\AdminMode; | ||
use Pimcore\Bootstrap; | ||
|
||
final class BootstrapPimcore | ||
{ | ||
private const DEFAULT_ENV_VARS = [ | ||
'APP_ENV' => 'test', | ||
]; | ||
|
||
public static function bootstrap(string ...$envVars): void | ||
{ | ||
foreach ($envVars + self::DEFAULT_ENV_VARS as $name => $value) { | ||
self::setEnv($name, $value); | ||
} | ||
|
||
Bootstrap::setProjectRoot(); | ||
Bootstrap::bootstrap(); | ||
AdminMode::disable(); | ||
} | ||
|
||
public static function setEnv(string $name, string $value): void | ||
{ | ||
putenv("{$name}=" . $_ENV[$name] = $_SERVER[$name] = $value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Neusta\Pimcore\TestingFramework\Pimcore; | ||
|
||
use Pimcore\Bootstrap; | ||
use \Neusta\Pimcore\TestingFramework\BootstrapPimcore as RootBootstrapPimcore; | ||
|
||
trigger_deprecation( | ||
'teamneusta/pimcore-testing-framework', | ||
'0.13', | ||
'The "%s" class is deprecated, use "%s" instead.', | ||
BootstrapPimcore::class, | ||
RootBootstrapPimcore::class, | ||
); | ||
|
||
final class BootstrapPimcore | ||
{ | ||
private const DEFAULT_ENV_VARS = [ | ||
'APP_ENV' => 'test', | ||
]; | ||
class_alias(RootBootstrapPimcore::class, BootstrapPimcore::class); | ||
|
||
public static function bootstrap(string ...$envVars): void | ||
if (false) { | ||
/** | ||
* @deprecated since 0.13, use Neusta\Pimcore\TestingFramework\BootstrapPimcore instead | ||
*/ | ||
final class BootstrapPimcore | ||
{ | ||
foreach ($envVars + self::DEFAULT_ENV_VARS as $name => $value) { | ||
self::setEnv($name, $value); | ||
public static function bootstrap(string ...$envVars): void | ||
{ | ||
} | ||
|
||
Bootstrap::setProjectRoot(); | ||
Bootstrap::bootstrap(); | ||
AdminMode::disable(); | ||
} | ||
|
||
public static function setEnv(string $name, string $value): void | ||
{ | ||
putenv("{$name}=" . $_ENV[$name] = $_SERVER[$name] = $value); | ||
public static function setEnv(string $name, string $value): void | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters