write($qrCode);
- echo '
';
+ echo '
';
// generate the QRCode
echo '
',_("Scanner ceci avec votre application OTP"),'
';
+
?>
+
+ ';
+ echo _("Scanner ce QRCode avec votre application OTP afin de l'ajouter");
+ echo '';
+ echo '
';
+
+ echo _("Dans votre application OTP vous devez avoir ce nombre ");
+
+ ?>
+
+ =$authenticator->compute_code($secret)?>
+
+
+ ';
+ ?>
+ ', base64_encode($result->getString()));
+
+} catch (Exception $exc) {
+ record_log($e);
+ return;
+}
+?>
+
+
+
=_("Installation d'une application OTP")?>
+
+ =_("Si vous n'en avez pas installé sur votre smartphone ou PC, voici notre sélection")?>
+
+
+ =_("Android")?>
+
-
FreeOTP (libre)
@@ -195,22 +236,43 @@ try {
Google Authenticator
- ';
- echo _("Scanner ce QRCode avec votre application OTP afin de l'ajouter");
-
- if ( DEBUGNOALYSS > 1) { echo "code attendu",$authenticator->code();}
- echo '';
-
-
- printf('

', base64_encode($result->getString()));
-
-} catch (Exception $exc) {
- record_log($e);
- return;
-}
-?>
-
+
+ =_('IPhone')?>
+
+
+
+ -
+ FreeOTP (libre)
+
+
+
+ PC
+
+
+
+ =_("Article à propos de otpclient")?>
+
+ OTPClient , un outil très utile sous PC
+
+
+ =_('Debian , Ubuntu,...')?>
+
+ apt install otpclient
+
+
+
+ -
+ Site OTPClient
+
+
+
+
+
\ No newline at end of file
diff --git a/unit-test/include/Ajax/ajax_miscTest.php b/unit-test/include/Ajax/ajax_miscTest.php
index f5e94c81e..0113995fc 100644
--- a/unit-test/include/Ajax/ajax_miscTest.php
+++ b/unit-test/include/Ajax/ajax_miscTest.php
@@ -146,8 +146,9 @@ class Ajax_MiscTest extends TestCase
);
$_REQUEST = $_POST = $_GET = $query;
+
ob_start();
- require NOALYSS_HOME . '/fid.php';
+ include NOALYSS_HOME . '/fid.php';
$content = ob_get_contents();
ob_end_clean();
@@ -155,10 +156,41 @@ class Ajax_MiscTest extends TestCase
{"flabel":"e_march4_label","name":"Inserted by PHPUNIT-Ajax_MiscTest:createCard_MA1 ","ftva_id":"e_march4_tva_id","tva_id":"210A","fPrice_sale":"e_march4_price","sell":"0","fPrice_purchase":"e_march4_price","buy":"0","answer":"ok"}
EOF;
- $this->assertEquals($expected, $content, "Incorrect answer");
+ $this->assertEquals($expected, $content, "Incorrect answer $content");
// clean card
$this->cleanCard($fiche->id);
}
+
+ public function testComputeQRCODE()
+ {
+ $_POST['secret']="QJPJXHOJ77B76WYEFURCSHRMVI7JC7FBRJA2QH34T4SXANVQUDYA";
+ $_POST['action']="qr_refresh";
+ ob_start();
+ include NOALYSS_HOME."/compute.php";
+ $x= ob_get_contents();
+ ob_end_clean();
+ $this->assertTrue($x==floatval($x),"Invalid return $x");
+ }
+ public function testCompute1()
+ {
+ $_POST=$_REQUEST=$_GET=array (
+ 'gDossier' => DOSSIER,
+ 'c'=>'PORA',
+ 't'=>1,
+ 'p'=>600,
+ 'q'=>1,
+ 'n'=>0,
+ 'other_tax_id' => -1
+ );
+
+ ob_start();
+ include NOALYSS_HOME."/compute.php";
+ $content = ob_get_contents();
+ ob_end_clean();
+ $expected='{"ctl":0,"htva":600,"tva":126,"tvac":"726.0000","other_tax":0}'."\n";
+
+ $this->assertEquals($expected, $content, "Incorrect answer $content");
+ }
}
\ No newline at end of file
diff --git a/unit-test/include/class/Acc_DocumentTest.php b/unit-test/include/class/Acc_DocumentTest.php
index 53fc2d1f9..109bd431b 100644
--- a/unit-test/include/class/Acc_DocumentTest.php
+++ b/unit-test/include/class/Acc_DocumentTest.php
@@ -194,17 +194,6 @@ class Acc_DocumentTest extends TestCase {
// return array([1], [2], [3]);
// }
- /**
- * @testdox description of the test
- * @covers Acc_Balance::summary_add
- * @depend Acc_Balance::summary_init
- * @backupGlobals enabled
- * @dataProvider dataExample
- * @global $g_connection
- */
- function testFunction() {
-
- }
/**
* @testdox Test the standard invoice, check file
* @covers Document::generate
diff --git a/unit-test/include/class/Acc_TVATest.php b/unit-test/include/class/Acc_TVATest.php
index 9bf8bfb3f..15573f0e3 100644
--- a/unit-test/include/class/Acc_TVATest.php
+++ b/unit-test/include/class/Acc_TVATest.php
@@ -128,7 +128,7 @@ class Acc_TVATest extends TestCase
return array(
['S',true,null]
,['Z',true,null]
- ,['A',false,""]
+ ,['A',true,""]
,['K',true,"XX"]
);
}
@@ -159,7 +159,7 @@ class Acc_TVATest extends TestCase
if ( $result != $check)
{
print "Error for $peppopl_code\n";
- print_r($tva_rate_mtable->aerror);
+ print_r($tva_rate_mtable->get_aerror());
$this->display_error($tva_rate_mtable);
}
}
diff --git a/unit-test/include/class/FacturXTest.php b/unit-test/include/class/FacturXTest.php
index 0053f65ca..739b92ce4 100644
--- a/unit-test/include/class/FacturXTest.php
+++ b/unit-test/include/class/FacturXTest.php
@@ -49,6 +49,9 @@ class FacturXTest extends TestCase {
function testBuild_Data() {
$cn=\Dossier::connect();
$facturx=new \Noalyss\XMLDocument\FacturX($cn);
+ $data=$facturx->get_data() ;
+ $this->assertTrue($data == []
+ ," Build Data fails : get null value");
}
@@ -137,6 +140,6 @@ class FacturXTest extends TestCase {
$customer=$facturx->get_data()['customer'];
$a_error = $facturx->check_customer_data($customer['card_id']);
print_r($a_error);
- $this->assertTrue(count($a_error)==6, "nb of error incorrect ,expected 6, received = ".print_r($a_error,true));
+ $this->assertTrue(count($a_error)==5, "nb of error incorrect (JR_INTERNAL=V000002),expected 5, received = ".print_r($a_error,true));
}
}
diff --git a/unit-test/include/class/InvoiceUBL21Test.php b/unit-test/include/class/InvoiceUBL21Test.php
index 70b4c647d..8798bc30b 100644
--- a/unit-test/include/class/InvoiceUBL21Test.php
+++ b/unit-test/include/class/InvoiceUBL21Test.php
@@ -50,6 +50,7 @@ class InvoiceUBL21Test extends TestCase {
function testBuild_Data() {
$cn = \Dossier::connect();
$ublinvoice21 = new \Noalyss\XMLDocument\InvoiceUBL21($cn);
+ $this->assertTrue($ublinvoice21->get_data()==[],"Data is not empty");
}
/**
@@ -170,6 +171,6 @@ class InvoiceUBL21Test extends TestCase {
$ublinvoice21->build_data(2);
$customer = $ublinvoice21->get_data()['customer'];
$a_error=$ublinvoice21->check_customer_data($customer['card_id']);
- $this->assertTrue(count($a_error) ==6 , " nb of errors incorrect ".print_r($a_error,true));
+ $this->assertTrue(count($a_error) ==7 , " nb of errors incorrect ".print_r($a_error,true));
}
}