Yaffs site version 1.1
[yaffs-website] / web / modules / contrib / advagg / src / Tests / AdvaggPathManipulationTest.php
1 <?php
2
3 namespace Drupal\advagg\Tests;
4
5 /**
6  * Tests that all the asset path settings function correctly.
7  *
8  * @ingroup advagg_tests
9  *
10  * @group advagg
11  */
12 class AdvaggPathManipulationTest extends AdvaggTestBase {
13
14   /**
15    * Modules to enable.
16    *
17    * @var array
18    */
19   public static $modules = ['advagg', 'advagg_test'];
20
21   /**
22    * Tests force_https.
23    */
24   public function testForceHttps() {
25     $this->config->set('path.convert.force_https', TRUE)
26       ->set('path.convert.absolute_to_protocol_relative', FALSE)
27       ->save();
28     $this->drupalGet('');
29     $this->assertRaw('src="https://cdn.jsdelivr.net/jquery.actual/1.0.18/jquery.actual.min.js');
30   }
31
32   /**
33    * Tests absolute_to_protocol_relative.
34    */
35   public function testAbsoluteToProtocolRelative() {
36     $this->config->set('path.convert.absolute_to_protocol_relative', TRUE)
37       ->set('path.convert.force_https', FALSE)
38       ->save();
39     $this->drupalGet('');
40     $this->assertRaw('src="//cdn.jsdelivr.net/jquery.actual/1.0.18/jquery.actual.min.js');
41   }
42
43 }