Skip to content

Commit 28c682d

Browse files
committed
test(TestCase): Update setUp and tearDown methods
- Updated the 'setUp' method to include calling 'startMockery' - Updated the 'tearDown' method to include calling 'closeMockery'
1 parent 9431a62 commit 28c682d

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

config/exception-notify.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@
6060
],
6161

6262
/**
63-
* The title of exception notification report.
63+
* The creator of report using.
6464
*/
65-
'title' => env('EXCEPTION_NOTIFY_TITLE', sprintf('The %s application exception report', config('app.name'))),
65+
'report_using_creator' => env('EXCEPTION_NOTIFY_REPORT_USING_CREATOR', ReportUsingCreator::class),
6666

6767
/**
68-
* The creator of report using.
68+
* The title of exception notification report.
6969
*/
70-
'report_using_creator' => env('EXCEPTION_NOTIFY_REPORT_USING_CREATOR', ReportUsingCreator::class),
70+
'title' => env('EXCEPTION_NOTIFY_TITLE', sprintf('The %s application exception report', config('app.name'))),
7171

7272
/**
7373
* The list of collector.

tests/ExceptionNotifyManagerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
->report(new Exception)->toBeNull();
4242

4343
config()->set('exception-notify.enabled', true);
44-
$mockApplication = Mockery::spy(Application::class);
45-
// $mockApplication->allows('make')->with('config')->andReturn(config());
46-
$mockApplication->allows('runningInConsole')->andReturnFalse();
44+
$mockApplication = Mockery::spy(Illuminate\Foundation\Application::class);
45+
// $mockApplication->allows()->make('config')->atLeast()->once()->andReturn(config());
46+
$mockApplication->allows()->runningInConsole()->atLeast()->once()->andReturnFalse();
4747

4848
/** @noinspection PhpVoidFunctionResultUsedInspection */
4949
expect(new ExceptionNotifyManager($mockApplication))

tests/TestCase.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,15 @@ class TestCase extends \Orchestra\Testbench\TestCase
4949
use MockeryPHPUnitIntegration;
5050
use VarDumperTestTrait;
5151

52+
protected function setUp(): void
53+
{
54+
parent::setUp();
55+
$this->startMockery();
56+
}
57+
5258
protected function tearDown(): void
5359
{
54-
\Mockery::close();
60+
$this->closeMockery();
5561
parent::tearDown();
5662
}
5763

0 commit comments

Comments
 (0)