TEST : update
This commit is contained in:
parent
9f466e8cdc
commit
b26e377c58
7 changed files with 148 additions and 20 deletions
|
|
@ -48,10 +48,10 @@ class Acc_BalanceTest extends TestCase
|
|||
$min=$g_connection->get_value("select min(p_id) from parm_periode");
|
||||
$this->object->jrn=NULL;
|
||||
$array=$this->object->get_row($min,$max);
|
||||
$this->assertEquals(14,count($array));
|
||||
$this->assertEquals(29,count($array));
|
||||
$this->object->jrn=[2,4];
|
||||
$array=$this->object->get_row($min,$max);
|
||||
$this->assertEquals(7,count($array));
|
||||
$this->assertEquals(10,count($array));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -186,19 +186,149 @@ class Acc_ComputeTest extends TestCase
|
|||
{
|
||||
ob_start();
|
||||
$this->object->display();
|
||||
$result= ob_get_flush();
|
||||
$result=ob_get_contents();
|
||||
$this->assertStringStartsWith("key amount Description amount value is 0<br>key amount_vat Description amount_vat value is 0<br>",$result);
|
||||
$this->assertStringEndsWith("<br>key amount_perso_rate Description amount_perso_rate value is 0<br>",$result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Acc_Compute::test_me
|
||||
* @todo Implement testTest_me().
|
||||
*/
|
||||
public function testTest_me()
|
||||
public function testCompute()
|
||||
{
|
||||
$this->object->test_me();
|
||||
$this->assertTrue(true,true);
|
||||
}
|
||||
$a=new Acc_Compute();
|
||||
// Compute some operation to see if the computed amount are
|
||||
// correct
|
||||
|
||||
//Test VAT
|
||||
$a->set_parameter('amount',1.23);
|
||||
$a->set_parameter('amount_vat_rate',0.21);
|
||||
|
||||
|
||||
$a->compute_vat();
|
||||
$this->assertEquals($a->amount_vat,0.26);
|
||||
try
|
||||
{
|
||||
$a->verify();
|
||||
$this->assertTrue(TRUE);
|
||||
}
|
||||
catch (Exception $exc)
|
||||
{
|
||||
echo $exc->getMessage();
|
||||
error_log($exc->getTraceAsString());
|
||||
$this->assertTrue(FALSE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Test VAT + perso
|
||||
$a=new Acc_Compute();
|
||||
$a->set_parameter('amount',1.23);
|
||||
$a->set_parameter('amount_vat_rate',0.21);
|
||||
$a->set_parameter('amount_perso_rate',0.5);
|
||||
$b=clone $a;
|
||||
$a->compute_vat();
|
||||
$this->assertEquals($a->amount_vat,0.26);
|
||||
$a->compute_perso();
|
||||
$this->assertEquals($a->amount_perso,0.01);
|
||||
$a->correct();
|
||||
$this->assertEquals($a->amount_vat,0.26);
|
||||
$this->assertEquals($a->amount_perso,0.01);
|
||||
|
||||
$a->verify($b);
|
||||
|
||||
// TEST VAT + ND
|
||||
// Test VAT + perso
|
||||
$a=new Acc_Compute();
|
||||
$a->set_parameter('amount',1.23);
|
||||
$a->set_parameter('amount_vat_rate',0.21);
|
||||
$a->set_parameter('nd_vat_rate',0.5);
|
||||
$b=clone $a;
|
||||
echo '<h1> Test VAT + ND VAT</h1>';
|
||||
echo '<h2> Data </h2>';
|
||||
$a->display();
|
||||
$a->compute_vat();
|
||||
$a->compute_nd_vat();
|
||||
$a->correct();
|
||||
echo '<h2> Result </h2>';
|
||||
$a->display();
|
||||
$a->verify($b);
|
||||
// TEST VAT + ND
|
||||
// Test VAT + perso
|
||||
$a=new Acc_Compute();
|
||||
$a->set_parameter('amount',1.23);
|
||||
$a->set_parameter('amount_vat_rate',0.21);
|
||||
$a->set_parameter('nd_vat_rate',0.5);
|
||||
$a->set_parameter('amount_perso_rate',0.5);
|
||||
|
||||
$b=clone $a;
|
||||
echo '<h1> Test VAT + ND VAT + perso</h1>';
|
||||
echo '<h2> Data </h2>';
|
||||
$a->display();
|
||||
$a->compute_vat();
|
||||
$a->compute_perso();
|
||||
$a->compute_nd_vat();
|
||||
$a->correct();
|
||||
echo '<h2> Result </h2>';
|
||||
$a->display();
|
||||
$a->verify($b);
|
||||
// TEST VAT + ND
|
||||
$a=new Acc_Compute();
|
||||
$a->set_parameter('amount',1.23);
|
||||
$a->set_parameter('amount_vat_rate',0.21);
|
||||
$a->set_parameter('amount_nd_rate',0.5);
|
||||
|
||||
$b=clone $a;
|
||||
echo '<h1> Test VAT + ND </h1>';
|
||||
echo '<h2> Data </h2>';
|
||||
$a->display();
|
||||
$a->compute_vat();
|
||||
$a->compute_nd();
|
||||
|
||||
$a->compute_perso();
|
||||
$a->compute_nd_vat();
|
||||
$a->correct();
|
||||
echo '<h2> Result </h2>';
|
||||
$a->display();
|
||||
$a->verify($b);
|
||||
// TEST VAT + ND
|
||||
// + Perso
|
||||
$a=new Acc_Compute();
|
||||
$a->set_parameter('amount',1.23);
|
||||
$a->set_parameter('amount_vat_rate',0.21);
|
||||
$a->set_parameter('amount_nd_rate',0.5);
|
||||
$a->set_parameter('amount_perso_rate',0.2857);
|
||||
$b=clone $a;
|
||||
echo '<h1> Test VAT + ND + Perso</h1>';
|
||||
echo '<h2> Data </h2>';
|
||||
$a->display();
|
||||
$a->compute_vat();
|
||||
$a->compute_nd();
|
||||
|
||||
$a->compute_perso();
|
||||
$a->compute_nd_vat();
|
||||
$a->correct();
|
||||
echo '<h2> Result </h2>';
|
||||
$a->display();
|
||||
$a->verify($b);
|
||||
// TEST VAT + ND
|
||||
// + Perso
|
||||
$a=new Acc_Compute();
|
||||
$a->set_parameter('amount',1.23);
|
||||
$a->set_parameter('amount_vat_rate',0.21);
|
||||
$a->set_parameter('nd_ded_vat_rate',0.5);
|
||||
|
||||
$b=clone $a;
|
||||
echo '<h1> Test VAT + TVA ND DED</h1>';
|
||||
echo '<h2> Data </h2>';
|
||||
$a->display();
|
||||
$a->compute_vat();
|
||||
$a->compute_nd();
|
||||
|
||||
$a->compute_perso();
|
||||
$a->compute_nd_vat();
|
||||
$a->compute_ndded_vat();
|
||||
$a->correct();
|
||||
echo '<h2> Result </h2>';
|
||||
$a->display();
|
||||
$a->verify($b);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class Acc_Ledger_History_FinancialTest extends TestCase
|
|||
function testGet__row()
|
||||
{
|
||||
$this->object->get_row();
|
||||
$this->assertEquals(1, count($this->object->get_data()));
|
||||
$this->assertEquals(5, count($this->object->get_data()));
|
||||
}
|
||||
|
||||
//@covers Acc_Ledger_History_Financial::export_html
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class Acc_Ledger_History_PurchaseTest extends TestCase
|
|||
function testGet_Row()
|
||||
{
|
||||
$this->object->get_row();
|
||||
$this->assertSame(count($this->object->get_data()),2);
|
||||
$this->assertSame(count($this->object->get_data()),65);
|
||||
|
||||
}
|
||||
//@covers Acc_Ledger_History_Financial::export_oneline_html
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class Acc_Ledger_SoldTest extends TestCase
|
|||
"action"=>"use_opd",
|
||||
"jrn_type"=>"VEN",
|
||||
"filter"=>"",
|
||||
"e_date"=>"24.04.2018",
|
||||
"e_date"=>"24.08.2019",
|
||||
"e_ech"=>"",
|
||||
"e_client"=>"CLIENT",
|
||||
"e_pj"=>"VEN10",
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@ class Anc_GrandLivreTest extends TestCase
|
|||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object=new Anc_GrandLivre;
|
||||
global $g_connection;
|
||||
$this->object=new Anc_GrandLivre($g_connection);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -32,14 +33,10 @@ class Anc_GrandLivreTest extends TestCase
|
|||
|
||||
/**
|
||||
* @covers Anc_GrandLivre::set_sql_filter
|
||||
* @todo Implement testSet_sql_filter().
|
||||
*/
|
||||
public function testSet_sql_filter()
|
||||
{
|
||||
// Remove the following lines when you implement this test.
|
||||
$this->markTestIncomplete(
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ class Noalyss_Parameter_FolderTest extends TestCase
|
|||
"MY_DATE_SUGGEST,".
|
||||
"MY_ALPHANUM,".
|
||||
"MY_UPDLAB,".
|
||||
"MY_ANC_FILTER,".
|
||||
"MY_STOCK");
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue