Skip to content

Commit

Permalink
Merge branch '7.x' into 8.x
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Dec 8, 2024
2 parents 768ffc8 + 08edfb7 commit b945ecd
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/analyse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: analyse

on:
push:
branches:
- '*.x'
pull_request:
workflow_dispatch:

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/audits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: audits

on:
push:
branches:
- '*.x'
pull_request:
workflow_dispatch:

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/collision-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: collision-tests

on:
push:
branches:
- '*.x'
pull_request:
workflow_dispatch:

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/coveralls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ name: coveralls

on:
push:
branches:
- '*.x'
pull_request:
workflow_dispatch:

jobs:
tests:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/parallel-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: parallel-tests

on:
push:
branches:
- '*.x'
pull_request:
workflow_dispatch:

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ name: tests

on:
push:
branches:
- '*.x'
pull_request:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
tests:
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://getcomposer.org/schema.json",
"name": "orchestra/testbench-core",
"description": "Testing Helper for Laravel Development",
"homepage": "https://packages.tools/testbench",
Expand Down
9 changes: 6 additions & 3 deletions src/Exceptions/ApplicationNotAvailableException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@

use RuntimeException;

/**
* @internal
*/
class ApplicationNotAvailableException extends RuntimeException
{
/**
* Make new RuntimeException when application is not available.
*
* @param string $method
* @param string|null $caller
* @return static
*/
public static function make(string $method)
public static function make(?string $caller)
{
return new static("Application is not available to run [{$method}]");
return new static(\sprintf('Application is not available to run [%s]', $caller ?? 'N/A'));
}
}
3 changes: 2 additions & 1 deletion src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -473,12 +473,13 @@ function laravel_or_fail($app, ?string $caller = null): Application
}

if (\is_null($caller)) {
$caller = transform(debug_backtrace()[1], function ($debug) {
$caller = transform(debug_backtrace()[1] ?? null, function ($debug) {
/** @phpstan-ignore isset.offset */
if (isset($debug['class']) && isset($debug['function'])) {
return \sprintf('%s::%s', $debug['class'], $debug['function']);
}

/** @phpstan-ignore offsetAccess.notFound */
return $debug['function'];
});
}
Expand Down
4 changes: 1 addition & 3 deletions tests/HelpersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ public function it_can_compare_phpunit_version()
$this->assertTrue(phpunit_version_compare(Version::id(), '=='));
}

/**
* @test
*/
/** @test */
public function it_can_throw_application_not_available_application_when_app_is_not_laravel()
{
$this->expectException(ApplicationNotAvailableException::class);
Expand Down

0 comments on commit b945ecd

Please sign in to comment.