Skip to content
Snippets Groups Projects
Commit 30f06985 authored by Demian Katz's avatar Demian Katz Committed by Robert Lange
Browse files

Add/fix/improve comments.

parent ec56dd51
No related merge requests found
...@@ -43,17 +43,22 @@ class LessCompilerTest extends Unit\TestCase ...@@ -43,17 +43,22 @@ class LessCompilerTest extends Unit\TestCase
/** /**
* Our brave test subject * Our brave test subject
* *
* @var VuFindTheme\LessCompiler * @var string
*/ */
protected $testDest; protected $testDest;
/** /**
* Our brave test subject * Our brave test subject
* *
* @var VuFindTheme\LessCompiler * @var LessCompiler
*/ */
protected $compiler; protected $compiler;
/**
* Initial class setup.
*
* @return void
*/
public static function setUpBeforeClass(): void public static function setUpBeforeClass(): void
{ {
$temp = sys_get_temp_dir(); $temp = sys_get_temp_dir();
...@@ -93,6 +98,11 @@ class LessCompilerTest extends Unit\TestCase ...@@ -93,6 +98,11 @@ class LessCompilerTest extends Unit\TestCase
); );
} }
/**
* Individual test setup.
*
* @return void
*/
public function setUp(): void public function setUp(): void
{ {
$temp = sys_get_temp_dir(); $temp = sys_get_temp_dir();
...@@ -106,6 +116,11 @@ class LessCompilerTest extends Unit\TestCase ...@@ -106,6 +116,11 @@ class LessCompilerTest extends Unit\TestCase
$this->compiler->setTempPath($temp . '/vufind_less_comp_test/cache'); $this->compiler->setTempPath($temp . '/vufind_less_comp_test/cache');
} }
/**
* Final teardown method.
*
* @return void
*/
public static function tearDownAfterClass(): void public static function tearDownAfterClass(): void
{ {
$temp = sys_get_temp_dir(); $temp = sys_get_temp_dir();
...@@ -114,7 +129,14 @@ class LessCompilerTest extends Unit\TestCase ...@@ -114,7 +129,14 @@ class LessCompilerTest extends Unit\TestCase
self::delTree($testDest); self::delTree($testDest);
} }
// adapted from http://php.net/manual/en/function.rmdir.php /**
* Delete a directory tree; adapted from
* http://php.net/manual/en/function.rmdir.php
*
* @param string $dir Directory to delete.
*
* @return void
*/
protected static function delTree($dir) protected static function delTree($dir)
{ {
$files = array_diff(scandir($dir), ['.', '..']); $files = array_diff(scandir($dir), ['.', '..']);
...@@ -125,6 +147,11 @@ class LessCompilerTest extends Unit\TestCase ...@@ -125,6 +147,11 @@ class LessCompilerTest extends Unit\TestCase
rmdir($dir); rmdir($dir);
} }
/**
* Test compiling a single theme.
*
* @return void
*/
public function testThemeCompile() public function testThemeCompile()
{ {
$this->compiler->compile(['child']); $this->compiler->compile(['child']);
...@@ -133,6 +160,11 @@ class LessCompilerTest extends Unit\TestCase ...@@ -133,6 +160,11 @@ class LessCompilerTest extends Unit\TestCase
unlink($this->testDest . 'themes/child/css/compiled.css'); unlink($this->testDest . 'themes/child/css/compiled.css');
} }
/**
* Test compiling all themes.
*
* @return void
*/
public function testAllCompile() public function testAllCompile()
{ {
$this->compiler->compile([]); $this->compiler->compile([]);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment