2012-07-12 20:40:06 -04:00
|
|
|
<?php
|
|
|
|
|
require_once PATH_TRUNK . 'gulliver/thirdparty/smarty/libs/Smarty.class.php';
|
|
|
|
|
require_once PATH_TRUNK . 'gulliver/system/class.xmlform.php';
|
|
|
|
|
require_once PATH_TRUNK . 'gulliver/system/class.xmlDocument.php';
|
|
|
|
|
require_once PATH_TRUNK . 'gulliver/system/class.form.php';
|
|
|
|
|
require_once PATH_TRUNK . 'gulliver/system/class.dbconnection.php';
|
|
|
|
|
require_once PATH_TRUNK . 'gulliver/thirdparty/propel/Propel.php';
|
|
|
|
|
require_once PATH_TRUNK . 'gulliver/thirdparty/creole/Creole.php';
|
|
|
|
|
require_once PATH_TRUNK . 'gulliver/thirdparty/pear/PEAR.php';
|
|
|
|
|
require_once PATH_TRUNK . 'workflow/engine/classes/class.archive.php';
|
2012-05-10 20:57:25 -04:00
|
|
|
|
2012-07-12 20:40:06 -04:00
|
|
|
/**
|
2012-07-12 22:34:02 -04:00
|
|
|
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:30.
|
2012-07-12 20:40:06 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
class classarchiveTest extends PHPUnit_Framework_TestCase
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @var archive
|
|
|
|
|
*/
|
|
|
|
|
protected $object;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets up the fixture, for example, opens a network connection.
|
|
|
|
|
* This method is called before a test is executed.
|
|
|
|
|
*/
|
|
|
|
|
protected function setUp()
|
|
|
|
|
{
|
2012-07-13 18:37:01 -04:00
|
|
|
$this->object = new archive('name');
|
2012-07-12 20:40:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Tears down the fixture, for example, closes a network connection.
|
|
|
|
|
* This method is called after a test is executed.
|
|
|
|
|
*/
|
|
|
|
|
protected function tearDown()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This is the default method to test, if the class still having
|
|
|
|
|
* the same number of methods.
|
|
|
|
|
*/
|
|
|
|
|
public function testNumberOfMethodsInThisClass()
|
|
|
|
|
{
|
2012-07-13 18:37:01 -04:00
|
|
|
$methods = get_class_methods('archive');
|
|
|
|
|
$this->assertTrue( count($methods) == 12);
|
2012-07-12 20:40:06 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers archive::archive
|
|
|
|
|
* @todo Implement testarchive().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testarchive()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('archive', $methods ), 'exists method archive' );
|
|
|
|
|
$r = new ReflectionMethod('archive', 'archive');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'name');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
2012-07-13 18:37:01 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers archive::set_options
|
|
|
|
|
* @todo Implement testset_options().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testset_options()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('set_options', $methods ), 'exists method set_options' );
|
|
|
|
|
$r = new ReflectionMethod('archive', 'set_options');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'options');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
2012-07-13 18:37:01 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers archive::create_archive
|
|
|
|
|
* @todo Implement testcreate_archive().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testcreate_archive()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('create_archive', $methods ), 'exists method create_archive' );
|
|
|
|
|
$r = new ReflectionMethod('archive', 'create_archive');
|
|
|
|
|
$params = $r->getParameters();
|
2012-07-13 18:37:01 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers archive::add_data
|
|
|
|
|
* @todo Implement testadd_data().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testadd_data()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('add_data', $methods ), 'exists method add_data' );
|
|
|
|
|
$r = new ReflectionMethod('archive', 'add_data');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'data');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
2012-07-13 18:37:01 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers archive::make_list
|
|
|
|
|
* @todo Implement testmake_list().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testmake_list()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('make_list', $methods ), 'exists method make_list' );
|
|
|
|
|
$r = new ReflectionMethod('archive', 'make_list');
|
|
|
|
|
$params = $r->getParameters();
|
2012-07-13 18:37:01 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers archive::add_files
|
|
|
|
|
* @todo Implement testadd_files().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testadd_files()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('add_files', $methods ), 'exists method add_files' );
|
|
|
|
|
$r = new ReflectionMethod('archive', 'add_files');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'list');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
2012-07-13 18:37:01 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers archive::exclude_files
|
|
|
|
|
* @todo Implement testexclude_files().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testexclude_files()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('exclude_files', $methods ), 'exists method exclude_files' );
|
|
|
|
|
$r = new ReflectionMethod('archive', 'exclude_files');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'list');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
2012-07-13 18:37:01 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers archive::store_files
|
|
|
|
|
* @todo Implement teststore_files().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function teststore_files()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('store_files', $methods ), 'exists method store_files' );
|
|
|
|
|
$r = new ReflectionMethod('archive', 'store_files');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'list');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
2012-07-13 18:37:01 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers archive::list_files
|
|
|
|
|
* @todo Implement testlist_files().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testlist_files()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('list_files', $methods ), 'exists method list_files' );
|
|
|
|
|
$r = new ReflectionMethod('archive', 'list_files');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'list');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
2012-07-13 18:37:01 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers archive::parse_dir
|
|
|
|
|
* @todo Implement testparse_dir().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testparse_dir()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('parse_dir', $methods ), 'exists method parse_dir' );
|
|
|
|
|
$r = new ReflectionMethod('archive', 'parse_dir');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'dirname');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
2012-07-13 18:37:01 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers archive::sort_files
|
|
|
|
|
* @todo Implement testsort_files().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testsort_files()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('sort_files', $methods ), 'exists method sort_files' );
|
|
|
|
|
$r = new ReflectionMethod('archive', 'sort_files');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'a');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
|
|
|
$this->assertTrue( $params[1]->getName() == 'b');
|
|
|
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
2012-07-13 18:37:01 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers archive::download_file
|
|
|
|
|
* @todo Implement testdownload_file().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testdownload_file()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('download_file', $methods ), 'exists method download_file' );
|
|
|
|
|
$r = new ReflectionMethod('archive', 'download_file');
|
|
|
|
|
$params = $r->getParameters();
|
2012-07-13 18:37:01 -04:00
|
|
|
}
|
|
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|