23 lines
		
	
	
		
			495 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			495 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| namespace nulib\cache;
 | |
| 
 | |
| use nulib\output\msg;
 | |
| 
 | |
| class CursorChannelTest extends _TestCase {
 | |
|   function testUsage() {
 | |
|     $data = [
 | |
|       "fr" => ["a" => "un", "b" => "deux"],
 | |
|       "eng" => ["a" => "one", "b" => "two"],
 | |
|       ["a" => 1, "b" => 2],
 | |
|     ];
 | |
| 
 | |
|     $channel = CacheChannel::with($data, "numbers", self::$storage);
 | |
|     $count = 0;
 | |
|     foreach ($channel as $key => $item) {
 | |
|       msg::info("one: $key => {$item["a"]}");
 | |
|       $count++;
 | |
|     }
 | |
|     self::assertSame(3, $count);
 | |
|   }
 | |
| }
 |