Projet

Général

Profil

Paste
Télécharger (18 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / link / tests / link.crud_browser.test @ 8e7483ab

1 85ad3d82 Assos Assos
<?php
2
3
/**
4
 * @file
5
 * Testing CRUD API in the browser.
6
 */
7
8
/**
9 39a181a4 Assos Assos
 * Testing that users can not input bad URLs or labels.
10 85ad3d82 Assos Assos
 */
11 8e7483ab Assos Assos
class LinkUiTest extends DrupalWebTestcase {
12 85ad3d82 Assos Assos
13
  /**
14 39a181a4 Assos Assos
   * Link supposed to be good.
15 85ad3d82 Assos Assos
   */
16
  const LINK_INPUT_TYPE_GOOD = 0;
17
18
  /**
19 39a181a4 Assos Assos
   * Link supposed to have a bad title.
20 85ad3d82 Assos Assos
   */
21
  const LINK_INPUT_TYPE_BAD_TITLE = 1;
22
23
  /**
24 39a181a4 Assos Assos
   * Link supposed to have a bad URL.
25 85ad3d82 Assos Assos
   */
26
  const LINK_INPUT_TYPE_BAD_URL = 2;
27
28 39a181a4 Assos Assos
  /**
29
   * Get Info.
30
   */
31 85ad3d82 Assos Assos
  public static function getInfo() {
32
    return array(
33
      'name' => 'Link CRUD - browser test',
34
      'description' => 'Tests the field CRUD (create, read, update, delete) API 2.',
35
      'group' => 'Link',
36
    );
37
  }
38
39 39a181a4 Assos Assos
  /**
40 8e7483ab Assos Assos
   * {@inheritdoc}
41 39a181a4 Assos Assos
   */
42 8e7483ab Assos Assos
  public function setUp(array $modules = array()) {
43
    $modules[] = 'field_ui';
44
    $modules[] = 'link';
45
    parent::setUp($modules);
46 85ad3d82 Assos Assos
  }
47
48
  /**
49
   * Creates a link field for the "page" type and creates a page with a link.
50
   */
51 39a181a4 Assos Assos
  public function testLinkCreate() {
52
    // libxml_use_internal_errors(true);
53 85ad3d82 Assos Assos
    $this->web_user = $this->drupalCreateUser(array(
54
      'administer content types',
55 39a181a4 Assos Assos
      'administer fields',
56 85ad3d82 Assos Assos
      'administer nodes',
57
      'administer filters',
58
      'access content',
59
      'create page content',
60 39a181a4 Assos Assos
      'access administration pages',
61 85ad3d82 Assos Assos
    ));
62
    $this->drupalLogin($this->web_user);
63
64 39a181a4 Assos Assos
    // Create field.
65 85ad3d82 Assos Assos
    $name = strtolower($this->randomName());
66
    $edit = array(
67
      'fields[_add_new_field][label]' => $name,
68
      'fields[_add_new_field][field_name]' => $name,
69
      'fields[_add_new_field][type]' => 'link_field',
70
      'fields[_add_new_field][widget_type]' => 'link_field',
71
    );
72
    $this->drupalPost('admin/structure/types/manage/page/fields', $edit, t('Save'));
73
    $this->drupalPost(NULL, array(), t('Save field settings'));
74
    $this->drupalPost(NULL, array(), t('Save settings'));
75
76
    // Is field created?
77
    $this->assertRaw(t('Saved %label configuration', array('%label' => $name)), 'Field added');
78
    node_types_rebuild();
79
    menu_rebuild();
80
81
    $permission = 'create page content';
82
    $this->checkPermissions(array($permission), TRUE);
83
84 39a181a4 Assos Assos
    // Create page form
85
    // $this->drupalGet('node/add');.
86 85ad3d82 Assos Assos
    $this->drupalGet('node/add/page');
87
    $field_name = 'field_' . $name;
88 c8740e19 Assos Assos
    $this->assertField('edit-field-' . $name . '-und-0-title', 'Title found');
89
    $this->assertField('edit-field-' . $name . '-und-0-url', 'URL found');
90 85ad3d82 Assos Assos
91
    $input_test_cases = array(
92
      array(
93
        'href' => 'http://example.com/' . $this->randomName(),
94
        'label' => $this->randomName(),
95
        'msg' => 'Link found',
96 39a181a4 Assos Assos
        'type' => self::LINK_INPUT_TYPE_GOOD,
97 85ad3d82 Assos Assos
      ),
98
      array(
99
        'href' => 'http://example.com/' . $this->randomName(),
100
        'label' => $this->randomName() . '<script>alert("hi");</script>',
101
        'msg' => 'js label',
102 39a181a4 Assos Assos
        'type' => self::LINK_INPUT_TYPE_BAD_TITLE,
103 85ad3d82 Assos Assos
      ),
104
      array(
105
        'href' => 'http://example.com/' . $this->randomName(),
106
        'label' => $this->randomName() . '<script src="http://devil.site.com"></script>',
107
        'msg' => 'js label',
108 39a181a4 Assos Assos
        'type' => self::LINK_INPUT_TYPE_BAD_TITLE,
109 85ad3d82 Assos Assos
      ),
110
      array(
111
        'href' => 'http://example.com/' . $this->randomName(),
112
        'label' => $this->randomName() . '" onmouseover="alert(\'hi\')',
113
        'msg' => 'js label',
114 39a181a4 Assos Assos
        'type' => self::LINK_INPUT_TYPE_BAD_TITLE,
115 85ad3d82 Assos Assos
      ),
116
      array(
117
        'href' => 'http://example.com/' . $this->randomName(),
118
        'label' => $this->randomName() . '\' onmouseover="alert(\'hi\')',
119
        'msg' => 'js label',
120 39a181a4 Assos Assos
        'type' => self::LINK_INPUT_TYPE_BAD_TITLE,
121 85ad3d82 Assos Assos
      ),
122
      array(
123
        'href' => 'javascript:alert("http://example.com/' . $this->randomName() . '")',
124
        'label' => $this->randomName(),
125
        'msg' => 'js url',
126 39a181a4 Assos Assos
        'type' => self::LINK_INPUT_TYPE_BAD_URL,
127 85ad3d82 Assos Assos
      ),
128
      array(
129
        'href' => 'http://ecs-es.kelkoo.es/ctl/go/sitesearchGo?.ts=1338833010331&.sig=qP9GXeEFH6syBzwmzYkxmsvp1EI-',
130
        'label' => 'http://ecs-es.kelkoo.es/ctl/go/sitesearchGo?.ts=1338833010331&.sig=qP9GXeEFH6syBzwmzYkxmsvp1EI-',
131
        'msg' => 'Url with . in querystring',
132
        'type' => self::LINK_INPUT_TYPE_GOOD,
133
      ),
134
    );
135
    $test_case = array(
136 c8740e19 Assos Assos
      'href' => 'www.example.com/' . $this->randomName(),
137 85ad3d82 Assos Assos
      'label' => $this->randomName(),
138
      'msg' => 'Link found',
139
      'type' => self::LINK_INPUT_TYPE_GOOD,
140
    );
141 c8740e19 Assos Assos
    $test_case['expected_href'] = 'http://' . $test_case['href'];
142 85ad3d82 Assos Assos
    $input_test_cases[] = $test_case;
143
144
    foreach ($input_test_cases as $input) {
145
      $this->drupalLogin($this->web_user);
146
      $this->drupalGet('node/add/page');
147
148
      $edit = array(
149
        'title' => $input['label'],
150
        $field_name . '[und][0][title]' => $input['label'],
151
        $field_name . '[und][0][url]' => $input['href'],
152
      );
153
      $this->drupalPost(NULL, $edit, t('Save'));
154
      if ($input['type'] == self::LINK_INPUT_TYPE_BAD_URL) {
155 39a181a4 Assos Assos
        $this->assertRaw(t('The value %value provided for %field is not a valid URL.', array(
156
          '%field' => $name,
157
          '%value' => trim($input['href']),
158
        )), 'Not a valid URL: ' . $input['href']);
159 85ad3d82 Assos Assos
        continue;
160
      }
161
      else {
162 c8740e19 Assos Assos
        $this->assertRaw(' ' . t('has been created.',
163 39a181a4 Assos Assos
            array('@type' => 'Basic Page', '%title' => $edit['title'])),
164
          'Page created: ' . $input['href']);
165 85ad3d82 Assos Assos
      }
166
      $url = $this->getUrl();
167
168 39a181a4 Assos Assos
      // Change to Anonymous user.
169 85ad3d82 Assos Assos
      $this->drupalLogout();
170
171
      $this->drupalGet($url);
172 39a181a4 Assos Assos
      // debug($this);
173
      // If simpletest starts using something to override the error system, this
174
      // will flag us and let us know it's broken.
175 85ad3d82 Assos Assos
      $this->assertFalse(libxml_use_internal_errors(TRUE));
176
      if (isset($input['expected_href'])) {
177 c8740e19 Assos Assos
        $path = '//a[@href="' . $input['expected_href'] . '" and text()="' . $input['label'] . '"]';
178 85ad3d82 Assos Assos
      }
179
      else {
180 c8740e19 Assos Assos
        $path = '//a[@href="' . $input['href'] . '" and text()="' . $input['label'] . '"]';
181 85ad3d82 Assos Assos
      }
182
      $elements = $this->xpath($path);
183
      libxml_use_internal_errors(FALSE);
184
      $this->assertIdentical(isset($elements[0]), $input['type'] == self::LINK_INPUT_TYPE_GOOD, $input['msg']);
185
    }
186 39a181a4 Assos Assos
    // libxml_use_internal_errors(FALSE);
187 85ad3d82 Assos Assos
  }
188
189
  /**
190 39a181a4 Assos Assos
   * Static Link Create.
191
   *
192 85ad3d82 Assos Assos
   * Testing that if you use <strong> in a static title for your link, that the
193
   * title actually displays <strong>.
194
   */
195 39a181a4 Assos Assos
  public function testStaticLinkCreate() {
196
    $this->web_user = $this->drupalCreateUser(array(
197
      'administer content types',
198
      'administer fields',
199
      'access content',
200
      'create page content',
201
    ));
202
203 85ad3d82 Assos Assos
    $this->drupalLogin($this->web_user);
204
205 39a181a4 Assos Assos
    // Create field.
206 85ad3d82 Assos Assos
    $name = strtolower($this->randomName());
207 c8740e19 Assos Assos
    $field_name = 'field_' . $name;
208 85ad3d82 Assos Assos
    $edit = array(
209
      'fields[_add_new_field][label]' => $name,
210
      'fields[_add_new_field][field_name]' => $name,
211
      'fields[_add_new_field][type]' => 'link_field',
212
      'fields[_add_new_field][widget_type]' => 'link_field',
213
    );
214
    $this->drupalPost('admin/structure/types/manage/page/fields', $edit, t('Save'));
215
    $this->drupalPost(NULL, array(), t('Save field settings'));
216
    $this->drupalPost(NULL, array(
217
      'instance[settings][title]' => 'value',
218 39a181a4 Assos Assos
      'instance[settings][title_value]' => '<strong>' . $name . '</strong>',
219
    ), t('Save settings'));
220 85ad3d82 Assos Assos
221
    // Is field created?
222
    $this->assertRaw(t('Saved %label configuration', array('%label' => $name)), 'Field added');
223
224 39a181a4 Assos Assos
    // Create page form.
225 85ad3d82 Assos Assos
    $this->drupalGet('node/add/page');
226
    $this->assertField($field_name . '[und][0][url]', 'URL found');
227
228
    $input = array(
229 39a181a4 Assos Assos
      'href' => 'http://example.com/' . $this->randomName(),
230 85ad3d82 Assos Assos
    );
231
232
    $edit = array(
233
      'title' => $name,
234
      $field_name . '[und][0][url]' => $input['href'],
235
    );
236
    $this->drupalPost(NULL, $edit, t('Save'));
237
238
    $url = $this->getUrl();
239
240 39a181a4 Assos Assos
    // Change to anonymous user.
241 85ad3d82 Assos Assos
    $this->drupalLogout();
242
    $this->drupalGet($url);
243
244 c8740e19 Assos Assos
    $this->assertRaw(l('<strong>' . $name . '</strong>', $input['href'], array('html' => TRUE)));
245
  }
246 39a181a4 Assos Assos
247 c8740e19 Assos Assos
  /**
248 39a181a4 Assos Assos
   * CRUD Title Only Title No Link.
249
   *
250
   * Testing that if you have the title but no url, the title is not sanitized
251
   * twice.
252 c8740e19 Assos Assos
   */
253 8e7483ab Assos Assos
  public function testCrudTitleOnlyTitleNoLink() {
254 39a181a4 Assos Assos
    $this->web_user = $this->drupalCreateUser(array(
255
      'administer content types',
256
      'administer fields',
257
      'access content',
258
      'create page content',
259
    ));
260 c8740e19 Assos Assos
    $this->drupalLogin($this->web_user);
261
262 39a181a4 Assos Assos
    // Create field.
263 c8740e19 Assos Assos
    $name = strtolower($this->randomName());
264
    $field_name = 'field_' . $name;
265
    $edit = array(
266
      'fields[_add_new_field][label]' => $name,
267
      'fields[_add_new_field][field_name]' => $name,
268
      'fields[_add_new_field][type]' => 'link_field',
269
      'fields[_add_new_field][widget_type]' => 'link_field',
270
    );
271
    $this->drupalPost('admin/structure/types/manage/page/fields', $edit, t('Save'));
272
    $this->drupalPost(NULL, array(), t('Save field settings'));
273
    $this->drupalPost(NULL, array(
274
      'instance[settings][url]' => 1,
275
    ), t('Save settings'));
276
277
    // Is field created?
278
    $this->assertRaw(t('Saved %label configuration', array('%label' => $name)), 'Field added');
279 39a181a4 Assos Assos
280
    // Create page form.
281 c8740e19 Assos Assos
    $this->drupalGet('node/add/page');
282
    $this->assertField($field_name . '[und][0][url]', 'URL found');
283
284
    $input = array(
285
      'title' => 'This & That',
286
      'href' => '',
287
    );
288
289
    $edit = array(
290
      'title' => $name,
291
      $field_name . '[und][0][title]' => $input['title'],
292
      $field_name . '[und][0][url]' => $input['href'],
293
    );
294
    $this->drupalPost(NULL, $edit, t('Save'));
295
296
    $url = $this->getUrl();
297 39a181a4 Assos Assos
298
    // Change to anonymous user.
299 c8740e19 Assos Assos
    $this->drupalLogout();
300
    $this->drupalGet($url);
301
302
    $this->assertRaw('This &amp; That');
303 85ad3d82 Assos Assos
  }
304
305
  /**
306 39a181a4 Assos Assos
   * CRUD Create Field Defaults.
307
   *
308
   * If we're creating a new field and just hit 'save' on the default options,
309
   * we want to make sure they are set to the expected results.
310 85ad3d82 Assos Assos
   */
311 8e7483ab Assos Assos
  public function testCrudCreateFieldDefaults() {
312 39a181a4 Assos Assos
    $this->web_user = $this->drupalCreateUser(array(
313
      'administer content types',
314
      'administer fields',
315
      'access content',
316
      'create page content',
317
    ));
318
319 85ad3d82 Assos Assos
    $this->drupalLogin($this->web_user);
320
321 39a181a4 Assos Assos
    // Create field.
322 85ad3d82 Assos Assos
    $name = strtolower($this->randomName());
323
    $edit = array(
324
      'fields[_add_new_field][label]' => $name,
325
      'fields[_add_new_field][field_name]' => $name,
326
      'fields[_add_new_field][type]' => 'link_field',
327
      'fields[_add_new_field][widget_type]' => 'link_field',
328
    );
329
    $this->drupalPost('admin/structure/types/manage/page/fields', $edit, t('Save'));
330
    $this->drupalPost(NULL, array(), t('Save field settings'));
331
    $this->drupalPost(NULL, array(), t('Save settings'));
332
333
    // Is field created?
334
    $this->assertRaw(t('Saved %label configuration', array('%label' => $name)), 'Field added');
335
    node_types_rebuild();
336
    menu_rebuild();
337 c8740e19 Assos Assos
338 85ad3d82 Assos Assos
    _field_info_collate_fields(TRUE);
339
    $instances = field_info_instances('node', 'page');
340 c8740e19 Assos Assos
341
    $instance = $instances['field_' . $name];
342 85ad3d82 Assos Assos
    $this->assertFalse($instance['required'], 'Make sure field is not required.');
343
    $this->assertEqual($instance['settings']['title'], 'optional', 'Title should be optional by default.');
344 c8740e19 Assos Assos
    $this->assertTrue($instance['settings']['validate_url'], 'Make sure validation is on.');
345
    $this->assertTrue($instance['settings']['enable_tokens'], 'Enable Tokens should be on by default.');
346 85ad3d82 Assos Assos
    $this->assertEqual($instance['settings']['display']['url_cutoff'], 80, 'Url cutoff should be at 80 characters.');
347
    $this->assertEqual($instance['settings']['attributes']['target'], 'default', 'Target should be "default"');
348
    $this->assertFalse($instance['settings']['attributes']['rel'], 'Rel should be blank by default.');
349
    $this->assertFalse($instance['settings']['attributes']['class'], 'By default, no class should be set.');
350
    $this->assertFalse($instance['settings']['title_value'], 'By default, no title should be set.');
351
  }
352 39a181a4 Assos Assos
353 7fe061e8 Assos Assos
  /**
354 39a181a4 Assos Assos
   * CRUD Create Field With Class.
355
   *
356
   * If we're creating a new field and just hit 'save' on the default options,
357
   * we want to make sure they are set to the expected results.
358 7fe061e8 Assos Assos
   */
359 8e7483ab Assos Assos
  public function testCrudCreateFieldWithClass() {
360 39a181a4 Assos Assos
    $this->web_user = $this->drupalCreateUser(array(
361
      'administer content types',
362
      'administer fields',
363
      'access content',
364
      'create page content',
365
    ));
366 7fe061e8 Assos Assos
    $this->drupalLogin($this->web_user);
367
368 39a181a4 Assos Assos
    // Create field.
369 7fe061e8 Assos Assos
    $name = strtolower($this->randomName());
370
    $edit = array(
371
      'fields[_add_new_field][label]' => $name,
372
      'fields[_add_new_field][field_name]' => $name,
373
      'fields[_add_new_field][type]' => 'link_field',
374
      'fields[_add_new_field][widget_type]' => 'link_field',
375
    );
376
    $this->drupalPost('admin/structure/types/manage/page/fields', $edit, t('Save'));
377
378
    $this->drupalPost(NULL, array(), t('Save field settings'));
379
    $link_class_name = 'basic-link-' . strtolower($this->randomName());
380
    $edit = array(
381
      'instance[settings][attributes][class]' => $link_class_name,
382
    );
383
    $this->drupalPost(NULL, $edit, t('Save settings'));
384
385
    // Is field created?
386
    $this->assertRaw(t('Saved %label configuration', array('%label' => $name)), 'Field added');
387
    node_types_rebuild();
388
    menu_rebuild();
389
390
    _field_info_collate_fields(TRUE);
391
    $instances = field_info_instances('node', 'page');
392
393
    $instance = $instances['field_' . $name];
394
    $this->assertFalse($instance['required'], 'Make sure field is not required.');
395
    $this->assertEqual($instance['settings']['title'], 'optional', 'Title should be optional by default.');
396
    $this->assertTrue($instance['settings']['validate_url'], 'Make sure validation is on.');
397
    $this->assertTrue($instance['settings']['enable_tokens'], 'Enable Tokens should be on by default.');
398
    $this->assertEqual($instance['settings']['display']['url_cutoff'], 80, 'Url cutoff should be at 80 characters.');
399
    $this->assertEqual($instance['settings']['attributes']['target'], 'default', 'Target should be "default"');
400
    $this->assertFalse($instance['settings']['attributes']['rel'], 'Rel should be blank by default.');
401
    $this->assertEqual($instance['settings']['attributes']['class'], $link_class_name, 'One class should be set.');
402
    $this->assertFalse($instance['settings']['title_value'], 'By default, no title should be set.');
403 39a181a4 Assos Assos
404 7fe061e8 Assos Assos
    // Now, let's create a node with this field and make sure the link shows up:
405 39a181a4 Assos Assos
    // create page form.
406 7fe061e8 Assos Assos
    $field_name = 'field_' . $name;
407
    $this->drupalGet('node/add/page');
408
    $this->assertField($field_name . '[und][0][url]', 'URL found');
409
410
    $input = array(
411
      'title' => 'This & That',
412
      'href' => 'http://www.example.com/',
413
    );
414
415
    $edit = array(
416
      'title' => $field_name,
417
      $field_name . '[und][0][title]' => $input['title'],
418
      $field_name . '[und][0][url]' => $input['href'],
419
    );
420
    $this->drupalPost(NULL, $edit, t('Save'));
421
422
    $url = $this->getUrl();
423 39a181a4 Assos Assos
424
    // Change to anonymous user.
425 7fe061e8 Assos Assos
    $this->drupalLogout();
426
    $this->drupalGet($url);
427
428
    $this->assertRaw('This &amp; That');
429
    $this->assertPattern('|class\s?=\s?"' . $link_class_name . '"|', "Class $link_class_name exists on page.");
430
  }
431
432 39a181a4 Assos Assos
  /**
433
   * CRUD Create Field With Two Classes.
434
   *
435
   * If we're creating a new field and just hit 'save' on the default options,
436
   * we want to make sure they are set to the expected results.
437 7fe061e8 Assos Assos
   */
438 8e7483ab Assos Assos
  public function testCrudCreateFieldWithTwoClasses() {
439 39a181a4 Assos Assos
    $this->web_user = $this->drupalCreateUser(array(
440
      'administer content types',
441
      'administer fields',
442
      'access content',
443
      'create page content',
444
    ));
445 7fe061e8 Assos Assos
    $this->drupalLogin($this->web_user);
446
447 39a181a4 Assos Assos
    // Create field.
448 7fe061e8 Assos Assos
    $name = strtolower($this->randomName());
449
    $edit = array(
450
      'fields[_add_new_field][label]' => $name,
451
      'fields[_add_new_field][field_name]' => $name,
452
      'fields[_add_new_field][type]' => 'link_field',
453
      'fields[_add_new_field][widget_type]' => 'link_field',
454
    );
455
    $this->drupalPost('admin/structure/types/manage/page/fields', $edit, t('Save'));
456
457
    $this->drupalPost(NULL, array(), t('Save field settings'));
458
    $link_class_name = 'basic-link ' . strtoupper($this->randomName());
459
    $edit = array(
460
      'instance[settings][attributes][class]' => $link_class_name,
461
    );
462
    $this->drupalPost(NULL, $edit, t('Save settings'));
463
464
    // Is field created?
465
    $this->assertRaw(t('Saved %label configuration', array('%label' => $name)), 'Field added');
466
    node_types_rebuild();
467
    menu_rebuild();
468
469
    _field_info_collate_fields(TRUE);
470
    $instances = field_info_instances('node', 'page');
471
472
    $instance = $instances['field_' . $name];
473
    $this->assertFalse($instance['required'], 'Make sure field is not required.');
474
    $this->assertEqual($instance['settings']['title'], 'optional', 'Title should be optional by default.');
475
    $this->assertTrue($instance['settings']['validate_url'], 'Make sure validation is on.');
476
    $this->assertTrue($instance['settings']['enable_tokens'], 'Enable Tokens should be on by default.');
477
    $this->assertEqual($instance['settings']['display']['url_cutoff'], 80, 'Url cutoff should be at 80 characters.');
478
    $this->assertEqual($instance['settings']['attributes']['target'], 'default', 'Target should be "default"');
479
    $this->assertFalse($instance['settings']['attributes']['rel'], 'Rel should be blank by default.');
480
    $this->assertEqual($instance['settings']['attributes']['class'], $link_class_name, 'Two classes should be set.');
481
    $this->assertFalse($instance['settings']['title_value'], 'By default, no title should be set.');
482 39a181a4 Assos Assos
483 7fe061e8 Assos Assos
    // Now, let's create a node with this field and make sure the link shows up:
484 39a181a4 Assos Assos
    // create page form.
485 7fe061e8 Assos Assos
    $field_name = 'field_' . $name;
486
    $this->drupalGet('node/add/page');
487
    $this->assertField($field_name . '[und][0][url]', 'URL found');
488
489
    $input = array(
490
      'title' => 'This & That',
491
      'href' => 'http://www.example.com/',
492
    );
493
494
    $edit = array(
495
      'title' => $field_name,
496
      $field_name . '[und][0][title]' => $input['title'],
497
      $field_name . '[und][0][url]' => $input['href'],
498
    );
499
    $this->drupalPost(NULL, $edit, t('Save'));
500
501
    $url = $this->getUrl();
502 39a181a4 Assos Assos
503
    // Change to anonymous user.
504 7fe061e8 Assos Assos
    $this->drupalLogout();
505
    $this->drupalGet($url);
506
507
    $this->assertRaw('This &amp; That');
508
    $this->assertPattern('|class\s?=\s?"' . $link_class_name . '"|', "Classes $link_class_name exist on page.");
509
  }
510 39a181a4 Assos Assos
511 85ad3d82 Assos Assos
}