1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/noalyss_ynh.git synced 2024-09-03 19:46:20 +02:00
noalyss_ynh/sources/unit-test/include/class_acc_accountTest.php
2015-09-27 00:54:25 +02:00

144 lines
3.4 KiB
PHP

<?php
/**
* Generated by PHPUnit_SkeletonGenerator on 2014-10-31 at 20:32:58.
* @backupGlobals enabled
*/
class Acc_AccountTest extends PHPUnit_Framework_TestCase
{
/**
* @var Acc_Account
*/
protected $object;
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
* @backupGlobals enabled
*/
protected function setUp()
{
global $g_connection;
$_REQUEST['gDossier'] = DOSSIER;
$g_connection=new Database(DOSSIER);
$this->object=new Acc_Account($g_connection,400);
$this->object->load();
}
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
protected function tearDown()
{
}
/**
* @covers Acc_Account::get_parameter
* @todo Implement testGet_parameter().
* @backupGlobals enabled
*/
public function testGet_parameter()
{
$value=$this->object->get_parameter("value");
$this->assertEquals($value,'400');
}
/**
* @covers Acc_Account::set_parameter
* @todo Implement testSet_parameter().
* @backupGlobals enabled
*/
public function testSet_parameter()
{
$this->object->set_parameter("value",500);
$value=$this->object->get_parameter("value");
$this->assertEquals($value,500);
}
/**
* @covers Acc_Account::get_lib
* @todo Implement testGet_lib().
*/
public function testGet_lib()
{
$value=$this->object->get_lib();
$this->assertEquals($value,'Clients');
}
/**
* @covers Acc_Account::check
* @todo Implement testCheck().
*/
public function testCheck()
{
$value=$this->object->check('pcm_val');
$this->assertTrue($value);
$value=$this->object->check('pcm_lib');
$this->assertTrue($value);
$value=$this->object->check('pcm_val_parent');
$this->assertTrue($value);
$value=$this->object->check('pcm_type','CHA');
$this->assertTrue($value);
$this->setExpectedException("Exception");
$value=$this->object->check('unknown');
}
/**
* @covers Acc_Account::load
* @todo Implement testLoad().
*/
public function testLoad()
{
$this->object->load();
}
/**
* @covers Acc_Account::form
* @todo Implement testForm().
*/
public function testForm()
{
$_REQUEST['gDossier']=36;
$this->object->form();
}
/**
* @covers Acc_Account::count
* @todo Implement testCount().
*/
public function testCount()
{
$this->assertEquals($this->object->count('550'),1);
$this->assertEquals($this->object->count('500'),0);
}
/**
* @covers Acc_Account::test_me
* @todo Implement testTest_me().
*/
public function testTest_me()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers Acc_Account::update
* @todo Implement testUpdate().
*/
public function testUpdate()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
}