public function FillPdfNodeTestCase::dataProvider in FillPDF 7
Data provider for testNodeLink() and testLegacyNodeLink().
Return value
array Array of test cases.
2 calls to FillPdfNodeTestCase::dataProvider()
- FillPdfNodeTestCase::testLegacyNodeLink in tests/
FillPdfNodeTestCase.test - Test fillpdf_pdf_link() with a single node in legacy format.
- FillPdfNodeTestCase::testNodeLink in tests/
FillPdfNodeTestCase.test - Test fillpdf_context_to_link() with nodes.
File
- tests/
FillPdfNodeTestCase.test, line 110
Class
- FillPdfNodeTestCase
- Tests parsing links for nodes.
Code
public function dataProvider() {
$base_url = url('fillpdf', array(
'query' => array(
'fid' => 1,
),
'absolute' => TRUE,
));
$test_cases = array();
// Test case: single node.
$test_cases[] = array(
'Single node',
array(
reset($this->nodes),
),
$base_url . '&nid=111',
);
// Test case: multiple nodes.
$test_cases[] = array(
'Multiple nodes',
$this->nodes,
$base_url . '&nids[0]=111&nids[1]=112&nids[2]=113',
);
// Test case: multiple nodes in reverse order.
$test_cases[] = array(
'Multiple nodes (in reverse order)',
array_reverse($this->nodes),
$base_url . '&nids[0]=113&nids[1]=112&nids[2]=111',
);
return $test_cases;
}