66
77use Drupal \node \Entity \Node ;
88use Drupal \workspaces \WorkspaceManagerInterface ;
9- use Drush \Commands \core \WorkspacesCommand ;
9+ use Drush \Commands \core \WorkspacePublishCommand ;
10+ use Drush \Commands \entity \EntityDeleteCommand ;
1011use Drush \Commands \pm \PmInstallCommand ;
12+ use Drush \Commands \pm \PmUninstallCommand ;
1113
1214/**
13- * Tests Workspaces commands
15+ * Tests Workspace commands
1416 *
1517 * @group commands
1618 */
17- class WorkspacesTest extends UnishIntegrationTestCase
19+ class WorkspaceTest extends UnishIntegrationTestCase
1820{
1921 private WorkspaceManagerInterface $ workspaceManager ;
2022
2123 protected function setUp (): void
2224 {
2325 parent ::setUp ();
24- $ this ->drush (PmInstallCommand::NAME , ['workspaces ' , 'node ' ]);
26+ $ this ->drush (PmInstallCommand::NAME , ['workspaces ' , 'node ' ], [ ' yes ' => true ] );
2527 $ this ->workspaceManager = \Drupal::service ('workspaces.manager ' );
2628
2729 // Create article content type if it doesn't exist
@@ -65,11 +67,11 @@ public function testWorkspaces(): void
6567 $ workspace_id = 'stage ' ;
6668
6769 // Publish the workspace
68- $ this ->drush (WorkspacesCommand ::NAME , [$ workspace_id ]);
70+ $ this ->drush (WorkspacePublishCommand ::NAME , [$ workspace_id ]);
6971 $ this ->assertStringContainsString ('Workspace Stage published ' , $ this ->getErrorOutput ());
7072
7173 // Verify no more changes exist after publishing
72- $ this ->drush (WorkspacesCommand ::NAME , [$ workspace_id ]);
74+ $ this ->drush (WorkspacePublishCommand ::NAME , [$ workspace_id ]);
7375 $ this ->assertStringContainsString ('There are no changes that can be published ' , $ this ->getErrorOutput ());
7476 }
7577
@@ -79,9 +81,9 @@ public function testWorkspaces(): void
7981 protected function tearDown (): void
8082 {
8183 // Cleanup the test workspace (this should also handle content deletion)
82- $ this ->drush (' entity:delete ' , ['workspace ' , 'stage ' ], ['yes ' => true ]);
83- $ this ->drush (' entity:delete ' , ['node ' ], ['yes ' => true , 'bundle ' => 'article ' ]);
84- $ this ->drush (' pm:uninstall ' , ['workspaces ' , 'node ' ], ['yes ' => true ]);
84+ $ this ->drush (EntityDeleteCommand:: NAME , ['workspace ' , 'stage ' ], ['yes ' => true ]);
85+ $ this ->drush (EntityDeleteCommand:: NAME , ['node ' ], ['yes ' => true , 'bundle ' => 'article ' ]);
86+ $ this ->drush (PmUninstallCommand:: NAME , ['workspaces ' , 'node ' ], ['yes ' => true ]);
8587 parent ::tearDown ();
8688 }
8789}
0 commit comments