Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
PU_test_dcp_importCVDOC.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  * @dataProvider dataBadCVDOC
19  */
20  public function testErrorImportCVDOC($familyFile, array $expectedErrors)
21  {
22  $this->requiresCoreParamEquals('CORE_LANG', 'fr_FR');
23 
24  $err = '';
25  try {
26  $this->importDocument($familyFile);
27  }
28  catch(\Exception $e) {
29  $err = $e->getMessage();
30  }
31  $this->assertNotEmpty($err, "no import error detected");
32  if (!is_array($expectedErrors)) $expectedErrors = array(
33  $expectedErrors
34  );
35 
36  foreach ($expectedErrors as $expectedError) {
37  $this->assertContains($expectedError, $err, sprintf("not the correct error reporting : %s", $err));
38  }
39  }
40 
41  public function dataBadCVDOC()
42  {
43  return array(
44  array(
45  "file" => "PU_data_dcp_importcvdocbad1.ods",
46  "errors" => array(
47  "DOC0111",
48  "[Identifiant de la vue]",
49  "DOC0111",
50  "[Label]"
51  ) ,
52  )
53  );
54  }
55 }
static importDocument($file)
testErrorImportCVDOC($familyFile, array $expectedErrors)
if($file) if($subject==""&&$file) if($subject=="") $err
requiresCoreParamEquals($paramName, $requiredValue, $markTestIncomplete=true)
← centre documentaire © anakeen