Permalink
Browse files

Unit tests further implemented

  • Loading branch information...
1 parent be5ba3f commit 7a0b3690ba9e7665455ac55412e2010214dd3c14 @kaviththiranga committed Jul 29, 2012
Showing with 9 additions and 3 deletions.
  1. +9 −3 tests/suites/unit/joomla/media/JMediaCompressorTest.php
@@ -72,18 +72,24 @@ public function testGetRatio()
$this->object->clear();
}
- public function testCompressString()
+ public function testCompressString()
{
+ $source = JPATH_BASE . '/test_files/css/comments.css';
+ $expected = JFile::read(str_ireplace('.css', '.min.css', $source));
+ $test = JMediaCompressor::compressString(JFile::read($source), array('type'=>'css'));
+
+
+ $this->assertEquals($expected, $test);
}
- public function testIsSupported()
+ public function testIsSupported()
{
$file1 = JPATH_BASE . '/test_files/css/comments.css';
$this->assertTrue(JMediaCompressor::isSupported($file1));
- $file2 = JPATH_BASE . '/test_files/js/case1.js';
+ $file2 = JPATH_BASE . '/test_files/js/case2.js';
$this->assertTrue(JMediaCompressor::isSupported($file2));
}

0 comments on commit 7a0b369

Please sign in to comment.