Skip to content

Commit

Permalink
Update Bootstrap.php
Browse files Browse the repository at this point in the history
Signed-off-by: Nathanael Esayeas <nathanael.esayeas@protonmail.com>
  • Loading branch information
ghostwriter committed Aug 5, 2023
1 parent 4c5d565 commit 3264adb
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions tests/Bootstrap.php
Expand Up @@ -35,15 +35,15 @@ function isAbsolutePath($path)
$root = realpath(dirname(dirname(__FILE__)));
$composerVendorDirectory = getenv('COMPOSER_VENDOR_DIR') ?: 'vendor';

if (! isAbsolutePath($composerVendorDirectory)) {
if (!isAbsolutePath($composerVendorDirectory)) {
$composerVendorDirectory = $root . DIRECTORY_SEPARATOR . $composerVendorDirectory;
}

/**
* Check that composer installation was done
*/
$autoloadPath = $composerVendorDirectory . DIRECTORY_SEPARATOR . 'autoload.php';
if (! file_exists($autoloadPath)) {
if (!file_exists($autoloadPath)) {
throw new Exception(
'Please run "php composer.phar install" in root directory '
. 'to setup unit test dependencies before running the tests'
Expand All @@ -67,17 +67,16 @@ function isAbsolutePath($path)
*/
unset($root, $autoloadPath, $hamcrestPath, $composerVendorDirectory);

$dev = false;

if ($dev) {
$mocksDirectory = __DIR__ . '/_mocks/';
if (! file_exists($mocksDirectory)) {
mkdir($mocksDirectory, 0777, true);
}
$mocksDirectory = __DIR__ . '/_mocks/';
if (!file_exists($mocksDirectory)) {
mkdir($mocksDirectory, 0777, true);
}

Mockery::setLoader(new Mockery\Loader\RequireLoader($mocksDirectory));
Mockery::setLoader(new Mockery\Loader\RequireLoader($mocksDirectory));

function vdd()
if (!function_exists('dd')) {
function dd(): void
{
var_dump(func_get_args());

Expand Down

0 comments on commit 3264adb

Please sign in to comment.