1616namespace DatabaseBackup \Test \TestCase \Command ;
1717
1818use Cake \Console \TestSuite \ConsoleIntegrationTestTrait ;
19- use Cake \Console \TestSuite \StubConsoleOutput ;
2019use Cake \Core \Configure ;
2120use DatabaseBackup \Command \ExportCommand ;
2221use DatabaseBackup \TestSuite \TestCase ;
@@ -36,6 +35,9 @@ class ExportCommandTest extends TestCase
3635{
3736 use ConsoleIntegrationTestTrait;
3837
38+ /**
39+ * @link \DatabaseBackup\Command\ExportCommand::buildOptionParser()
40+ */
3941 #[Test]
4042 #[RequiresOperatingSystemFamily('Linux ' )]
4143 public function testBuildOptionParser (): void
@@ -134,8 +136,10 @@ public function testExecuteWithCompressionOption(): void
134136 #[RunInSeparateProcess]
135137 public function testExecuteOnException (): void
136138 {
137- $ BackupExport = Mockery::mock ('overload: ' . BackupExport::class);
138- $ BackupExport ->shouldReceive ('export ' )->once ()->andThrow (new Exception ('Exception message ' ));
139+ Mockery::mock ('overload: ' . BackupExport::class)
140+ ->shouldReceive ('export ' )
141+ ->once ()
142+ ->andThrow (new Exception ('Exception message ' ));
139143
140144 $ this ->exec ('database_backup.export ' );
141145 $ this ->assertExitError ();
@@ -146,11 +150,12 @@ public function testExecuteOnException(): void
146150 #[RunInSeparateProcess]
147151 public function testExecuteOnStoppedEvent (): void
148152 {
149- $ BackupExport = Mockery::mock ('overload: ' . BackupExport::class);
150- $ BackupExport ->shouldReceive ('export ' )->once ()->andReturnFalse ();
153+ Mockery::mock ('overload: ' . BackupExport::class)
154+ ->shouldReceive ('export ' )
155+ ->once ()
156+ ->andReturnFalse ();
151157
152158 $ this ->exec ('database_backup.export ' );
153-
154159 $ this ->assertExitError ();
155160 $ this ->assertErrorContains ('<error>The `Backup.beforeExport` event stopped the operation</error> ' );
156161 }
0 commit comments