Skip to content

Commit

Permalink
style(src,tests) update doc lines
Browse files Browse the repository at this point in the history
  • Loading branch information
lucatume committed Nov 2, 2024
1 parent 07d796c commit 2dce0a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Utils/Composer.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ public static function vendorDir(?string $path = null): string
public static function autoloadPath(): string
{
/**
* if $_composer_autoload_path is undefined, fall back to vendor/autoload.php in the parent project's directory.
* If `$_composer_autoload_path` is undefined, fall back to `vendor/autoload.php` in the parent project's directory.
*
* @link https://getcomposer.org/doc/articles/vendor-binaries.md#finding-the-composer-autoloader-from-a-binary
*/
global $_composer_autoload_path;
if (isset($_composer_autoload_path)) {
$autoloadPath = $_composer_autoload_path;
} else {
// we use the Codecept class to find the location of Composer's vendor-dir, even if a project has renamed it
// We use the Codecept class to find the location of Composer's vendor-dir, even if a project has renamed it.
$vendorDir = dirname((string)(new \ReflectionClass(Codecept::class))->getFilename(), 5);
$autoloadPath = $vendorDir . DIRECTORY_SEPARATOR . 'autoload.php';
}
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/lucatume/WPBrowser/Utils/ComposerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ public function should_build_on_the_project_composer_file_if_no_composer_file_sp
*/
public function static_autoload_path_should_return_global_composer_autoload_path(): void
{
// Ensure that it's set for this test.
global $_composer_autoload_path;
// ensure that it's set for this test
$_composer_autoload_path = codecept_root_dir() . 'vendor/autoload.php';

$this->assertSame($_composer_autoload_path, Composer::autoloadPath() );
Expand All @@ -240,7 +240,6 @@ public function static_autoload_path_should_return_global_composer_autoload_path
*/
public function static_autoload_path_should_use_fallback(): void
{
global $_composer_autoload_path;
// clear value to enable fallback
unset($GLOBALS['_composer_autoload_path']);

Expand Down

0 comments on commit 2dce0a2

Please sign in to comment.