class TestWorkspaceNegotiator in Drupal 9
Same name and namespace in other branches
- 8 core/modules/workspaces/tests/modules/workspace_update_test/src/Negotiator/TestWorkspaceNegotiator.php \Drupal\workspace_update_test\Negotiator\TestWorkspaceNegotiator
Defines a workspace negotiator used for testing.
Hierarchy
- class \Drupal\workspace_update_test\Negotiator\TestWorkspaceNegotiator implements WorkspaceNegotiatorInterface
Expanded class hierarchy of TestWorkspaceNegotiator
1 string reference to 'TestWorkspaceNegotiator'
- workspace_update_test.services.yml in core/
modules/ workspaces/ tests/ modules/ workspace_update_test/ workspace_update_test.services.yml - core/modules/workspaces/tests/modules/workspace_update_test/workspace_update_test.services.yml
1 service uses TestWorkspaceNegotiator
- workspace_update_test.negotiator.test in core/
modules/ workspaces/ tests/ modules/ workspace_update_test/ workspace_update_test.services.yml - Drupal\workspace_update_test\Negotiator\TestWorkspaceNegotiator
File
- core/
modules/ workspaces/ tests/ modules/ workspace_update_test/ src/ Negotiator/ TestWorkspaceNegotiator.php, line 13
Namespace
Drupal\workspace_update_test\NegotiatorView source
class TestWorkspaceNegotiator implements WorkspaceNegotiatorInterface {
/**
* {@inheritdoc}
*/
public function applies(Request $request) {
return TRUE;
}
/**
* {@inheritdoc}
*/
public function getActiveWorkspace(Request $request) {
return Workspace::create([
'id' => 'test',
'label' => 'Test',
]);
}
/**
* {@inheritdoc}
*/
public function setActiveWorkspace(WorkspaceInterface $workspace) {
// Nothing to do here.
}
/**
* {@inheritdoc}
*/
public function unsetActiveWorkspace() {
// Nothing to do here.
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TestWorkspaceNegotiator:: |
public | function |
Checks whether the negotiator applies to the current request or not. Overrides WorkspaceNegotiatorInterface:: |
|
TestWorkspaceNegotiator:: |
public | function |
Gets the negotiated workspace, if any. Overrides WorkspaceNegotiatorInterface:: |
|
TestWorkspaceNegotiator:: |
public | function |
Sets the negotiated workspace. Overrides WorkspaceNegotiatorInterface:: |
|
TestWorkspaceNegotiator:: |
public | function |
Unsets the negotiated workspace. Overrides WorkspaceNegotiatorInterface:: |