|
@@ 27-37 (lines=11) @@
|
| 24 |
|
$this->assertEquals($expected, $tested); |
| 25 |
|
} |
| 26 |
|
|
| 27 |
|
public function testEmbedString() |
| 28 |
|
{ |
| 29 |
|
$origin = file_get_contents(__DIR__.'/rsc/test.css'); |
| 30 |
|
$expected = file_get_contents(__DIR__.'/rsc/expected.css'); |
| 31 |
|
|
| 32 |
|
$cssEmbed = new CssEmbed(); |
| 33 |
|
$cssEmbed->setRootDir(__DIR__.'/rsc'); |
| 34 |
|
$tested = $cssEmbed->embedString($origin); |
| 35 |
|
|
| 36 |
|
$this->assertEquals($expected, $tested); |
| 37 |
|
} |
| 38 |
|
|
| 39 |
|
public function mimeTypeProvider() |
| 40 |
|
{ |
|
@@ 69-79 (lines=11) @@
|
| 66 |
|
$this->assertEquals($expected, $tested); |
| 67 |
|
} |
| 68 |
|
|
| 69 |
|
public function testHttpEnabledEmbedString() |
| 70 |
|
{ |
| 71 |
|
$origin = file_get_contents(__DIR__.'/rsc/test-http.css'); |
| 72 |
|
$expected = file_get_contents(__DIR__.'/rsc/expected-http.css'); |
| 73 |
|
|
| 74 |
|
$cssEmbed = new CssEmbed(); |
| 75 |
|
$cssEmbed->enableHttp(); |
| 76 |
|
$cssEmbed->setRootDir('//httpbin.org/media/hypothetical-css-dir'); |
| 77 |
|
$tested = $cssEmbed->embedString($origin); |
| 78 |
|
$this->assertEquals($expected, $tested); |
| 79 |
|
} |
| 80 |
|
|
| 81 |
|
public function testSetHttpFlag() |
| 82 |
|
{ |
|
@@ 107-118 (lines=12) @@
|
| 104 |
|
$this->assertEquals($expected, $tested); |
| 105 |
|
} |
| 106 |
|
|
| 107 |
|
public function testHttpEmbedUrl() |
| 108 |
|
{ |
| 109 |
|
$origin = file_get_contents(__DIR__.'/rsc/test-http-url-only.css'); |
| 110 |
|
$expected = file_get_contents(__DIR__.'/rsc/expected-http-url-only.css'); |
| 111 |
|
|
| 112 |
|
$cssEmbed = new CssEmbed(); |
| 113 |
|
$cssEmbed->enableHttp(); |
| 114 |
|
$cssEmbed->setHttpFlag(CssEmbed::HTTP_EMBED_URL_ONLY); |
| 115 |
|
$cssEmbed->setRootDir('//httpbin.org/media/hypothetical-css-dir'); |
| 116 |
|
$tested = $cssEmbed->embedString($origin); |
| 117 |
|
$this->assertEquals($expected, $tested); |
| 118 |
|
} |
| 119 |
|
} |
| 120 |
|
|
| 121 |
|
class CssEmbedTestable extends CssEmbed |