Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixes to tests

  • Loading branch information...
commit 76cacf0e88a022582f62db2f4e0a21f14c1a4334 1 parent 91c966d
@kaviththiranga authored
View
16 tests/suites/unit/joomla/media/JMediaCollectionTest.php
@@ -19,6 +19,7 @@ class JMediaCollectionTest extends TestCase
* @var JMediaCollectionCss
*/
protected $object;
+
protected $files;
protected $pathToTestFiles;
@@ -32,10 +33,10 @@ class JMediaCollectionTest extends TestCase
*/
protected function setUp()
{
- $this->object = JMediaCompressor::getInstance(array('type' => 'css'));
+ $this->object = JMediaCollection::getInstance(array('type' => 'css'));
$this->pathToTestFiles = JPATH_TESTS . DIRECTORY_SEPARATOR . 'media' . DIRECTORY_SEPARATOR . 'css';
$this->loadFiles();
- $this->suffix = 'min';
+ $this->suffix = 'combined';
}
/**
@@ -69,7 +70,7 @@ public function testSetOptions()
public function testSetSources()
{
- $path = JPATH_BASE . '/test_files/css';
+ $path = JPATH_TESTS . DIRECTORY_SEPARATOR . 'media' . DIRECTORY_SEPARATOR . 'css';
$files = JFolder::files($path,'.',false,true, array(), array('.min.css', '.php', '.html','.combined.css'));//get full path
@@ -96,23 +97,22 @@ public function testGetInstance()
public function testGetCollectionTypes()
{
$expected = array('css','js');
-
+
$test = JMediaCollection::getCollectionTypes();
$this->assertEquals($expected, $test);
-
}
public function testCombineFiles()
{
// Path to source css files
- $path = JPATH_BASE . '/test_files/css';
+ $path = JPATH_TESTS . DIRECTORY_SEPARATOR . 'media' . DIRECTORY_SEPARATOR . 'css';
$files = JFolder::files($path,'.',false,true, array(), array('.min.css', '.php', '.html','.combined.css'));//get full path
$this->object->addFiles($files);
-
+
// Path to expected combined file without compression turned on
$expected = file_get_contents($path . '/all.combined.css');
@@ -158,7 +158,7 @@ public function testClear()
public function loadCssFiles()
{
// Path to source css files
- $path = JPATH_BASE . '/test_files/css';
+ $path = JPATH_TESTS . DIRECTORY_SEPARATOR . 'media' . DIRECTORY_SEPARATOR . 'css';;
$files = JFolder::files($path,'.',false,true, array(), array('.min.css', '.php', '.html','.combined.css'));//get full path
View
2  tests/suites/unit/joomla/media/collection/JMediaCollectionCssTest.php
@@ -35,7 +35,7 @@ protected function setUp()
$this->object = JMediaCollection::getInstance(array('type' => 'css'));
$this->pathToTestFiles = JPATH_TESTS . DIRECTORY_SEPARATOR . 'media' . DIRECTORY_SEPARATOR . 'css';
$this->loadFiles();
- $this->suffix = 'min';
+ $this->suffix = 'combined';
}
/**
View
2  tests/suites/unit/joomla/media/collection/JMediaCollectionJsTest.php
@@ -35,7 +35,7 @@ protected function setUp()
$this->object = JMediaCollection::getInstance(array('type' => 'js'));
$this->pathToTestFiles = JPATH_TESTS . DIRECTORY_SEPARATOR . 'media' . DIRECTORY_SEPARATOR . 'js';
$this->loadFiles();
- $this->suffix = 'min';
+ $this->suffix = 'combined';
}
/**
View
5 tests/suites/unit/joomla/media/compressor/JMediaCompressorCssTest.php
@@ -95,12 +95,11 @@ public function testCompress()
public function testClear()
{
- $sourceCss = JPATH_BASE . '/test_files/css/comments.css';
-
+ $sourceCss = JPATH_TESTS . DIRECTORY_SEPARATOR . 'media' . DIRECTORY_SEPARATOR . 'css/comments.css';
+
$this->object->setUncompressed(file_get_contents($sourceCss));
$this->object->compress();
$this->object->clear();
-
$this->assertEquals(null, $this->object->getUncompressed());
$this->assertEquals(null, $this->object->getcompressed());
$this->assertAttributeEquals(null, 'compressedSize', $this->object);
Please sign in to comment.
Something went wrong with that request. Please try again.