Skip to content

Commit 0f3f5e9

Browse files
committed
Add @link annotation and refine mock handling in BackupExportTest
Improves test reliability by enhancing mock usage for `FakeExecutor` and providing better documentation through added `@link` annotation.
1 parent 5499da1 commit 0f3f5e9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/TestCase/Utility/BackupExportTest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ public function testFilenamePropertyWithInvalidFilenameAndCompression(): void
159159
$this->BackupExport->filename = TMP . 'backup.txt';
160160
}
161161

162+
/**
163+
* @link \DatabaseBackup\Utility\BackupExport::__call()
164+
*/
162165
#[Test]
163166
public function testCallMagicMethod(): void
164167
{
@@ -209,12 +212,12 @@ public function testExportWithTimeoutFromConfiguration(): void
209212
Configure::write('DatabaseBackup.processTimeout', 45);
210213

211214
/** @var \DatabaseBackup\Executor\Executor&\Mockery\MockInterface $Executor */
212-
$Executor = Mockery::mock(FakeExecutor::class)->makePartial();
213-
$Executor
215+
$Executor = Mockery::mock(FakeExecutor::class . '[runProcess]')
214216
->shouldReceive('runProcess')
215217
->with(TMP . 'backup.sql', 45)
216218
->once()
217-
->andReturn(new ReflectionClass(Process::class)->newInstanceWithoutConstructor());
219+
->andReturn(new ReflectionClass(Process::class)->newInstanceWithoutConstructor())
220+
->getMock();
218221

219222
$this->BackupExport->Executor = $Executor;
220223

0 commit comments

Comments
 (0)