X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fworkflows%2Ftests%2Fsrc%2FFunctional%2FWorkflowUiTest.php;fp=web%2Fcore%2Fmodules%2Fworkflows%2Ftests%2Fsrc%2FFunctional%2FWorkflowUiTest.php;h=227ddd769a0c5d31f0a091f10d77a5911d44bc3e;hp=b15b24099c181e031cb82694fb5dd4f35a04d76c;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php b/web/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php index b15b24099..227ddd769 100644 --- a/web/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php +++ b/web/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php @@ -90,12 +90,19 @@ class WorkflowUiTest extends BrowserTestBase { ])->save(); $this->drupalLogin($this->createUser(['administer workflows'])); + $this->drupalPostForm('admin/config/workflow/workflows/manage/test_workflow/add_state', [ 'label' => 'Test State', 'id' => 'Invalid ID', ], 'Save'); $this->assertSession()->statusCodeEquals(200); $this->assertSession()->pageTextContains('The machine-readable name must contain only lowercase letters, numbers, and underscores.'); + + $this->drupalPostForm('admin/config/workflow/workflows/manage/test_workflow/add_transition', [ + 'label' => 'Test Transition', + 'id' => 'Invalid ID', + ], 'Save'); + $this->assertSession()->pageTextContains('The machine-readable name must contain only lowercase letters, numbers, and underscores.'); } /** @@ -109,7 +116,7 @@ class WorkflowUiTest extends BrowserTestBase { $this->assertSession()->linkByHrefExists('admin/config/workflow/workflows'); $this->clickLink('Workflows'); $this->assertSession()->pageTextContains('Workflows'); - $this->assertSession()->pageTextContains('There is no Workflow yet.'); + $this->assertSession()->pageTextContains('There are no workflows yet.'); $this->clickLink('Add workflow'); $this->submitForm(['label' => 'Test', 'id' => 'test', 'workflow_type' => 'workflow_type_test'], 'Save'); $this->assertSession()->pageTextContains('Created the Test Workflow.'); @@ -253,7 +260,7 @@ class WorkflowUiTest extends BrowserTestBase { $this->assertSession()->pageTextContains('Are you sure you want to delete Test?'); $this->submitForm([], 'Delete'); $this->assertSession()->pageTextContains('Workflow Test deleted.'); - $this->assertSession()->pageTextContains('There is no Workflow yet.'); + $this->assertSession()->pageTextContains('There are no workflows yet.'); $this->assertNull($workflow_storage->loadUnchanged('test'), 'The test workflow has been deleted'); // Ensure that workflow types with default configuration are initialized @@ -389,6 +396,21 @@ class WorkflowUiTest extends BrowserTestBase { foreach ($elements as $key => $element) { $this->assertEquals($expected_transitions[$key], $element->find('xpath', 'td')->getText()); } + + // Ensure that there are enough weights to satisfy the potential number of + // states and transitions. + $this->assertSession() + ->selectExists('states[three][weight]') + ->selectOption('2'); + $this->assertSession() + ->selectExists('states[three][weight]') + ->selectOption('-2'); + $this->assertSession() + ->selectExists('transitions[three][weight]') + ->selectOption('2'); + $this->assertSession() + ->selectExists('transitions[three][weight]') + ->selectOption('-2'); } }