Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Aug 26, 2024
1 parent 5216af2 commit e5080b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
17 changes: 7 additions & 10 deletions laravel/bootstrap/app.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<?php

use Orchestra\Testbench\Foundation\Application;
use Orchestra\Testbench\Foundation\Bootstrap\SyncTestbenchCachedRoutes;
use Orchestra\Testbench\Foundation\Config;
use Orchestra\Testbench\Workbench\Workbench;

use function Orchestra\Testbench\join_paths;

/**
* Create Laravel application.
*
Expand All @@ -16,8 +19,8 @@
);

$hasEnvironmentFile = ! is_null($config['laravel'])
? file_exists($config['laravel'].'/.env')
: file_exists("{$workingPath}/.env");
? file_exists(join_paths($config['laravel'], '.env'))
: file_exists(join_paths($workingPath, '.env'));

return Application::create(
basePath: $config['laravel'],
Expand All @@ -33,16 +36,10 @@
define('TESTBENCH_WORKING_PATH', getenv('TESTBENCH_WORKING_PATH'));
}

$app = $createApp(realpath(__DIR__.'/../'));
$app = $createApp(realpath(join_paths(__DIR__, '..')));

unset($createApp);

/** @var \Illuminate\Routing\Router $router */
$router = $app->make('router');

collect(glob(__DIR__.'/../routes/testbench-*.php'))
->each(static function ($routeFile) use ($app, $router) {
require $routeFile;
});
(new SyncTestbenchCachedRoutes)->bootstrap($app);

return $app;
4 changes: 2 additions & 2 deletions src/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ protected function driver(): RemoteWebDriver
}

return RemoteWebDriver::create(
Env::get('DUSK_DRIVER_URL') ?? sprintf('http://localhost:%d', static::$chromeDriverPort),
Env::get('DUSK_DRIVER_URL') ?? \sprintf('http://localhost:%d', static::$chromeDriverPort),
DesiredCapabilities::chrome()->setCapability(
ChromeOptions::CAPABILITY,
DuskOptions::getChromeOptions()
Expand Down Expand Up @@ -274,7 +274,7 @@ public static function setUpBeforeClass(): void
*/
protected static function defineChromeDriver(): void
{
static::startChromeDriver([sprintf('--port=%d', static::$chromeDriverPort)]);
static::startChromeDriver([\sprintf('--port=%d', static::$chromeDriverPort)]);
}

/**
Expand Down

0 comments on commit e5080b6

Please sign in to comment.