Core
3.2
PHP API documentation
Main Page
Related Pages
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Pages
PU_test_dcp_affect.php
Go to the documentation of this file.
1
<?php
2
/*
3
* @author Anakeen
4
* @package Dcp\Pu
5
*/
6
7
namespace
Dcp\Pu;
8
9
require_once
'PU_testcase_dcp_commonfamily.php'
;
10
11
class
TestAffect
extends
TestCaseDcpCommonFamily
12
{
13
14
public
static
function
getCommonImportFile
()
15
{
16
return
array(
17
'PU_data_dcp_TestAffect.ods'
18
);
19
}
20
21
protected
$famName
=
"TST_AFFECT1"
;
22
/**
23
* test basic affect hook
24
* @param string $family family name or id
25
* @return void
26
* @dataProvider dataAffect
27
*/
28
public
function
testAffect($family, $count, $one, $two)
29
{
30
$s
= new \SearchDoc(
self::$dbaccess
, $family);
31
$s
->setObjectReturn(
true
);
32
$s
->setOrder(
"initid"
);
33
$s
->search();
34
35
$this->assertEquals(
$s
->count(), $count);
36
$dl=
$s
->getDocumentList();
37
38
$k=0;
39
/**
40
* @var TestAffect1 $doc
41
*/
42
foreach
($dl as
$doc
) {
43
$this->assertEquals($one[$k],$doc->getOne(), sprintf(
"index %d => %s"
, $k, $doc->getOne()));
44
$this->assertEquals($two[$k],$doc->getTwo(), sprintf(
"index %d => %s"
, $k, $doc->getTwo()));
45
$k++;
46
}
47
}
48
49
public
function
dataAffect
()
50
{
51
return
array(
52
array($this->famName,6,
53
array(1,2,3,1,2,3),
54
array(0,0,0,2,4,6)
55
)
56
);
57
}
58
}
Dcp\Pu\TestCaseDcpCommonFamily
Definition:
PU_testcase_dcp_commonfamily.php:15
Dcp\Pu\TestAffect
Definition:
PU_test_dcp_affect.php:11
$s
if($famId) $s
Definition:
refreshDocuments.php:112
Dcp\Pu\TestAffect\$famName
$famName
Definition:
PU_test_dcp_affect.php:21
Dcp\Pu\TestAffect\getCommonImportFile
static getCommonImportFile()
Definition:
PU_test_dcp_affect.php:14
Dcp\Pu\TestAffect\dataAffect
dataAffect()
Definition:
PU_test_dcp_affect.php:49
$dbaccess
$dbaccess
Definition:
checkVault.php:17
$doc
$doc
Definition:
SetDocVaultIndex.php:39
← centre documentaire
© anakeen