Permalink
Browse files

fixes to unit test

  • Loading branch information...
kaviththiranga committed Jul 31, 2012
1 parent 019853b commit ffe1d9a999cb43fd9475234b485d257322b8410e
@@ -87,6 +87,8 @@ public function testGetCompressors()
public function testSetOptions()
{
+ $existing_options = $this->object->getOptions();
+
$expected = array('REMOVE_COMMENTS' => false, 'MIN_COLOR_CODES' => false, 'LIMIT_LINE_LENGTH' => false);
$this->object->setOptions($expected);
@@ -98,6 +100,8 @@ public function testSetOptions()
$this->arrayHasKey($key, $test);
$this->assertEquals($value, $test[$key]);
}
+ // Replace the existed options to avoid any harm to other tests
+ $this->object->setOptions($existing_options);
}
@@ -48,7 +48,26 @@ public function testSetUncompressed()
$this->object->clear();
}
- /*public function testCompress()
+ public function testSetOptions()
+ {
+ $existing_options = $this->object->getOptions();
+
+ $expected = array('REMOVE_COMMENTS' => false, 'MIN_COLOR_CODES' => false, 'LIMIT_LINE_LENGTH' => false);
+
+ $this->object->setOptions($expected);
+
+ $test = $this->object->getOptions();
+
+ foreach ($expected as $key => $value)
+ {
+ $this->arrayHasKey($key, $test);
+ $this->assertEquals($value, $test[$key]);
+ }
+ // Replace the existed options to avoid any harm to other tests
+ $this->object->setOptions($existing_options);
+ }
+
+ public function testCompress()
{
// Put the path to test files for css compressor. (Include expected result in filename.min.css file)
@@ -72,7 +91,7 @@ public function testSetUncompressed()
$this->object->clear();
}
- }*/
+ }
public function testClear()
{
@@ -58,7 +58,27 @@ public function testGetCompressed()
$this->object->clear();
}
- /*public function testCompress()
+ public function testSetOptions()
+ {
+ $existing_options = $this->object->getOptions();
+
+ $expected = array('REMOVE_COMMENTS' => false, 'CHANGE_ENCODING' => false);
+
+ $this->object->setOptions($expected);
+
+ $test = $this->object->getOptions();
+
+ foreach ($expected as $key => $value)
+ {
+ $this->arrayHasKey($key, $test);
+ $this->assertEquals($value, $test[$key]);
+ }
+ // Replace the existed options to avoid any harm to other tests
+ $this->object->setOptions($existing_options);
+
+ }
+
+ public function testCompress()
{
//Put the path to test files for java script compressor.
@@ -82,7 +102,7 @@ public function testGetCompressed()
$this->object->clear();
}
- }*/
+ }
public function test_checkAlphaNum()
{

0 comments on commit ffe1d9a

Please sign in to comment.