/iaLib/ia_examples/ia/Work/Workflow/WF_template_example.php
<?php
$ia_example = [
'title' => 'ia\Work\Workflow\WF_template', // fully qualified className
'summary' => '', // class summary
'full_example' => '', // full usage example, relative path from ia_examples, blank '' not shown.
'example_file' => 'code/ia/Work/Workflow/WF_template_example_code.php', // method by method example, blank '' not shown.
];
include( __DIR__ . '/../../../template/ia_example_class.php');
/iaLib/ia_examples/code/ia/Work/Workflow/WF_template_example_code.php
use ia\Work\Workflow\WF_template;
use ia\DocumentIt\DocumentIt;
echo '<h3>Disclaimer: Auto generated file.
Please help us setting parameters to useful values and extending the examples.
</h3>';
try {
echo <<< CONSTRUCTOR_PROTOTYPE
<pre>
/**
* WF_template constructor.
* @param array \$activityList
* @throws Exception
*/
/*
\$wF_template = new WF_template(<span class="type">array</span> \$activityList);
*/
\$wF_template = new WF_template(['a' => '1', 'b' => '2', 'c' => 3]);
</pre>
CONSTRUCTOR_PROTOTYPE;
$wF_template = new WF_template(['a' => '1', 'b' => '2', 'c' => 3]);
echo '<ul class="usage">';
///////// \$wF_template->get_activitiesEnd(); //////////////////////////////////////////////////
echo <<< FUNCTIONDEF
<li id='u_get_activitiesEnd'><b>\$wF_template->get_activitiesEnd() <span>: </span></b>
FUNCTIONDEF;
echo "<pre class='docBlock'>".DocumentIt::methodDocBlockProtected("ia\Work\Workflow\WF_template", "get_activitiesEnd")."</pre>";
echo "<ol class='usage'>";
/// display ///
echo <<< DOCUMENT_EXAMPLE
<li>\$wF_template->get_activitiesEnd();
-> </b><br><pre>
DOCUMENT_EXAMPLE;
/// run ///
print_r(
$wF_template->get_activitiesEnd()
);
echo "</pre>";
echo '</ol>';
///////// \$wF_template->get_activitiesStart(); //////////////////////////////////////////////////
echo <<< FUNCTIONDEF
<li id='u_get_activitiesStart'><b>\$wF_template->get_activitiesStart() <span>: </span></b>
FUNCTIONDEF;
echo "<pre class='docBlock'>".DocumentIt::methodDocBlockProtected("ia\Work\Workflow\WF_template", "get_activitiesStart")."</pre>";
echo "<ol class='usage'>";
/// display ///
echo <<< DOCUMENT_EXAMPLE
<li>\$wF_template->get_activitiesStart();
-> </b><br><pre>
DOCUMENT_EXAMPLE;
/// run ///
print_r(
$wF_template->get_activitiesStart()
);
echo "</pre>";
echo '</ol>';
///////// \$wF_template->get_activityList(); //////////////////////////////////////////////////
echo <<< FUNCTIONDEF
<li id='u_get_activityList'><b>\$wF_template->get_activityList() <span>: </span></b>
FUNCTIONDEF;
echo "<pre class='docBlock'>".DocumentIt::methodDocBlockProtected("ia\Work\Workflow\WF_template", "get_activityList")."</pre>";
echo "<ol class='usage'>";
/// display ///
echo <<< DOCUMENT_EXAMPLE
<li>\$wF_template->get_activityList();
-> </b><br><pre>
DOCUMENT_EXAMPLE;
/// run ///
print_r(
$wF_template->get_activityList()
);
echo "</pre>";
echo '</ol>';
/* PerfilExample adds new methods here */
echo '</ul>';
} catch(Exception $exception) { echo "<pre class='errorBlock'>$exception</pre>"; }
phpunit test file template
<?php
use ia\Work\Workflow\WF_template;
use PHPUnit\Framework\TestCase;
class WF_templateTest extends TestCase {
/**
* @dataProvider get_activitiesEnd_Provider
*
*/
public function test_get_activitiesEnd( $expected) {
$wF_template = new WF_template($activityList);
$this->assertEquals($expected, $wF_template->get_activitiesEnd() );
}
function get_activitiesEnd_Provider() {
return [
'test 1' => [ '' ],
];
}
/**
* @dataProvider get_activitiesStart_Provider
*
*/
public function test_get_activitiesStart( $expected) {
$wF_template = new WF_template($activityList);
$this->assertEquals($expected, $wF_template->get_activitiesStart() );
}
function get_activitiesStart_Provider() {
return [
'test 1' => [ '' ],
];
}
/**
* @dataProvider get_activityList_Provider
*
*/
public function test_get_activityList( $expected) {
$wF_template = new WF_template($activityList);
$this->assertEquals($expected, $wF_template->get_activityList() );
}
function get_activityList_Provider() {
return [
'test 1' => [ '' ],
];
}
}
ia Doc