64 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			64 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| namespace nulib\app\cli;
 | |
| 
 | |
| use nulib\app\args\Aogroup;
 | |
| use nulib\app\args\Aolist;
 | |
| use nulib\app\args\Aosection;
 | |
| use nur\t\TestCase;
 | |
| 
 | |
| class AolistTest extends TestCase {
 | |
|   function testGroup() {
 | |
|     $aogroup = new Aogroup([
 | |
|       "group",
 | |
|       ["--gopt1"],
 | |
|       ["--gopt2"],
 | |
|     ], true);
 | |
| 
 | |
|     echo "$aogroup\n";
 | |
|     self::assertTrue(true);
 | |
|   }
 | |
| 
 | |
|   function testSection() {
 | |
|     $aosection = new Aosection([
 | |
|       ["--sopt"],
 | |
|       ["group",
 | |
|         ["--sgopt1"],
 | |
|         ["--sgopt2"],
 | |
|       ],
 | |
|     ], true);
 | |
| 
 | |
|     echo "$aosection\n";
 | |
|     self::assertTrue(true);
 | |
|   }
 | |
| 
 | |
|   function testList() {
 | |
|     $aolist = new class([
 | |
|       "param" => "value",
 | |
|       ["--opt"],
 | |
|       ["group",
 | |
|         ["--gopt1"],
 | |
|         ["--gopt2"],
 | |
|       ],
 | |
|       "sections" => [
 | |
|         [
 | |
|           ["--s0opt"],
 | |
|           ["group",
 | |
|             ["--s0gopt1"],
 | |
|             ["--s0gopt2"],
 | |
|           ],
 | |
|         ],
 | |
|         "ns" => [
 | |
|           ["--nsopt"],
 | |
|           ["group",
 | |
|             ["--nsgopt1"],
 | |
|             ["--nsgopt2"],
 | |
|           ],
 | |
|         ],
 | |
|       ],
 | |
|     ]) extends Aolist {};
 | |
| 
 | |
|     echo "$aolist\n";
 | |
|     self::assertTrue(true);
 | |
|   }
 | |
| }
 |