Informática Asociada ia doc & examples: templates Documentation Index Examples List


/iaLib/ia_examples/ia/Lib/iaTableIt_example.php


<?php $ia_example = [ 'title' => 'ia\Lib\iaTableIt', // fully qualified className 'summary' => '', // class summary 'full_example' => '', // full usage example, relative path from ia_examples, blank '' not shown. 'example_file' => 'code/ia/Lib/iaTableIt_example_code.php', // method by method example, blank '' not shown. ]; include( __DIR__ . '/../../template/ia_example_class.php');

/iaLib/ia_examples/code/ia/Lib/iaTableIt_example_code.php


use ia\Lib\iaTableIt; 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 '<ul class="usage">'; ///////// iaTableIt::tableIt_css(); ////////////////////////////////////////////////// echo <<< FUNCTIONDEF <li id='u_tableIt_css'><b>iaTableIt::tableIt_css() <span>: void</span></b> FUNCTIONDEF; echo "<pre class='docBlock'>".DocumentIt::methodDocBlockProtected("ia\Lib\iaTableIt", "tableIt_css")."</pre>"; echo "<ol class='usage'>"; /// display /// echo <<< DOCUMENT_EXAMPLE <li>iaTableIt::tableIt_css();" DOCUMENT_EXAMPLE; /// run /// echo iaTableIt::tableIt_css(); echo '</ol>'; ///////// iaTableIt::tableIt(['a' => '1', 'b' => '2', 'c' => 3]); ////////////////////////////////////////////////// echo <<< FUNCTIONDEF <li id='u_tableIt'><b>iaTableIt::tableIt(<span class="type">array</span> \$arr, <span class="type">string</span> \$caption <span class="default">= ''</span>, <span class="type">array</span> \$header <span class="default">= []</span>, <span class="type">boolean</span> \$niceHeaders <span class="default">= true</span>, <span class="type">string</span> \$idPrefix <span class="default">= 'tblIt'</span>, <span class="type">string</span> \$tableClass <span class="default">= 'tableit'</span>) <span>: void</span></b> FUNCTIONDEF; echo "<pre class='docBlock'>".DocumentIt::methodDocBlockProtected("ia\Lib\iaTableIt", "tableIt")."</pre>"; echo "<ol class='usage'>"; /// display /// echo <<< DOCUMENT_EXAMPLE <li>iaTableIt::tableIt(['a' => '1', 'b' => '2', 'c' => 3]);" DOCUMENT_EXAMPLE; /// run /// echo iaTableIt::tableIt(['a' => '1', 'b' => '2', 'c' => 3]); 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\Lib\iaTableIt; use PHPUnit\Framework\TestCase; class iaTableItTest extends TestCase { /** * @dataProvider tableIt_css_Provider * */ public function test_tableIt_css( $expected) { $this->assertEquals($expected, iaTableIt::tableIt_css() ); } function tableIt_css_Provider() { return [ 'test 1' => [ '' ], ]; } /** * @dataProvider tableIt_Provider * */ public function test_tableIt($arr, $caption, $header, $niceHeaders, $idPrefix, $tableClass , $expected) { $this->assertEquals($expected, iaTableIt::tableIt($arr, $caption, $header, $niceHeaders, $idPrefix, $tableClass) ); } function tableIt_Provider() { return [ 'test 1' => [ '', '', '', '', '', '', '' ], ]; } }

ia Doc