Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
PU_test_dcp_fdlgen.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 
7 namespace Dcp\Pu;
8 /**
9  * @author Anakeen
10  * @package Dcp\Pu
11  */
12 
13 require_once 'PU_testcase_dcp_commonfamily.php';
14 
16 {
17  /**
18  * import some documents
19  * @static
20  * @return string
21  */
22  protected static function getCommonImportFile()
23  {
24  return array(
25  "PU_data_dcp_fdlgen.ods"
26  );
27  }
28  /**
29  * @dataProvider dataFdlGen
30  * @param string $docName
31  * @param string $expectValue
32  * @return \Doc
33  */
34  public function testFdlGen($docId, $attrName, $expectedValue)
35  {
36  $doc = new_doc(self::$dbaccess, $docId);
37  $this->assertTrue($doc->isAlive() , sprintf("Document with id '%s' is not alive.", $docId));
38  $value = $doc->getRawValue($attrName);
39  $this->assertEquals($expectedValue, $value, sprintf("Unexpected value '%s' for attribute '%s' (expected value is '%s').\nContent of 'FDLGEN/Class.Doc%d.php' = [[[\n%s\n]]]", $value, $attrName, $expectedValue, $doc->fromid, file_get_contents(sprintf('FDLGEN/Class.Doc%d.php', $doc->fromid))));
40  }
41 
42  public function dataFdlGen()
43  {
44  return array(
45  array(
46  "FDLGEN_EMPTY_1",
47  "ATTR_1",
48  "GOOD"
49  ) ,
50  array(
51  "FDLGEN_A_1",
52  "ATTR_1",
53  "A"
54  ) ,
55  array(
56  "FDLGEN_A_1",
57  "ATTR_2",
58  "AA"
59  ) ,
60  array(
61  "FDLGEN_A_1",
62  "ATTR_3",
63  "AAA"
64  ) ,
65  array(
66  "FDLGEN_A_1",
67  "ATTR_4",
68  "COMMON"
69  )
70  );
71  }
72 }
testFdlGen($docId, $attrName, $expectedValue)
$dbaccess
Definition: checkVault.php:17
$value
← centre documentaire © anakeen