Skip to content
Snippets Groups Projects

ISTWCMS-5434: Fixing php tests.

Merged Igor Biki requested to merge feature/ISTWCMS-5434-ibiki-php-tests into 3.1.x
1 file
+ 23
15
Compare changes
  • Side-by-side
  • Inline
@@ -1041,14 +1041,22 @@ class UwWcmsBasicTest extends BrowserTestBase {
}
$this->switchUser('uw_role_site_manager');
// Create the first taxonomy term which the vocab is
// catalog and the tid should be 49.
// catalog.
$editCatalog = [
'edit-name-0-value' => $this->randomString(),
];
$this->drupalGet('admin/structure/taxonomy/manage/uw_vocab_catalogs/add');
$this->submitForm($editCatalog, 'Save');
$this->clickLink($editCatalog['edit-name-0-value']);
// Get tid from new catalog term just created.
$tid = $this->xpath('//a[text() = "View"]');
preg_match('/^taxonomy\/term\/(\d+)$/', $tid[0]->getAttribute('data-drupal-link-system-path'), $matches);
$tid = (int) $matches[1];
$this->assertTrue($tid > 0, 'Positive tid found.');
// Create the second taxonomy term which the vocab is
// category and the tid should be 50.
// category and use 'apple' as category term.
$editCategory = [
'edit-name-0-value' => 'apple',
];
@@ -1056,12 +1064,12 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->submitForm($editCategory, 'Save');
// Prepare $editNode for creating a catalog item node.
// Use tid=49 as catalog term and tid=50 (apple) as category term.
// Select tid=15 (faculty of arts) as faculty term.
// Select tid=8 (Staff) as audience term.
// Use just created catalog term and 'apple' as category term.
// Select 'faculty of arts' as faculty term.
// Select 'Staff' as audience term.
$editNode = [
'edit-title-0-value' => 'Test catalog item',
'edit-field-uw-catalog-catalog-49' => 49,
'edit-field-uw-catalog-catalog-' . $tid => $tid,
'edit-field-uw-catalog-summary-0-value' => $this->randomString(),
'edit-moderation-state-0-state' => 'uw_wf_needs_review',
];
@@ -1081,15 +1089,15 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextContains('There are no catalogs available.');
$paths = [
'taxonomy/term/49',
'taxonomy/term/49/new',
'taxonomy/term/49/popular',
'taxonomy/term/49/audience',
'taxonomy/term/49/category',
'taxonomy/term/49/faculty',
'taxonomy/term/49/audience/staff',
'taxonomy/term/49/category/apple',
'taxonomy/term/49/faculty/faculty-of-arts',
'taxonomy/term/' . $tid,
'taxonomy/term/' . $tid . '/new',
'taxonomy/term/' . $tid . '/popular',
'taxonomy/term/' . $tid . '/audience',
'taxonomy/term/' . $tid . '/category',
'taxonomy/term/' . $tid . '/faculty',
'taxonomy/term/' . $tid . '/audience/staff',
'taxonomy/term/' . $tid . '/category/apple',
'taxonomy/term/' . $tid . '/faculty/faculty-of-arts',
];
foreach ($paths as $path) {
$this->drupalGet($path);
Loading