Skip to content

Commit 10c60bf

Browse files
committed
Refactor stub loading on the tests
This reduces the line lenghts (which travis was complaining about)
1 parent 5e5d621 commit 10c60bf

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/CssInlinerPluginTest.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@ class CssInlinerPluginTest extends PHPUnit_Framework_TestCase
88

99
protected $options;
1010

11+
protected static $stubDefinitions = array(
12+
'plain-text', 'original-html', 'converted-html', 'converted-html-with-classes',
13+
'converted-html-with-styles'
14+
);
15+
1116
public function setUp()
1217
{
13-
$this->stubs['plain-text'] = file_get_contents(__DIR__.'/stubs/plain-text.stub');
14-
$this->stubs['original-html'] = file_get_contents(__DIR__.'/stubs/original-html.stub');
15-
$this->stubs['converted-html'] = file_get_contents(__DIR__.'/stubs/converted-html.stub');
16-
$this->stubs['converted-html-with-classes'] = file_get_contents(__DIR__.'/stubs/converted-html-with-classes.stub');
17-
$this->stubs['converted-html-with-styles'] = file_get_contents(__DIR__.'/stubs/converted-html-with-styles.stub');
18+
foreach (self::$stubDefinitions as $stub) {
19+
$this->stubs[$stub] = file_get_contents(__DIR__.'/stubs/'.$stub.'.stub');
20+
}
1821

1922
$this->options = require(__DIR__.'/../config/css-inliner.php');
2023
}
@@ -144,5 +147,4 @@ public function itShouldConvertHtmlBodyAsAPart()
144147

145148
$this->assertEquals($this->stubs['converted-html'], $children[0]->getBody());
146149
}
147-
148150
}

0 commit comments

Comments
 (0)