set() public method

Set a value.
public set ( unknown $key, unknown $value, $delimiter = '/' )
$key unknown
$value unknown
コード例 #1
0
ファイル: ContainerTest.php プロジェクト: kohkimakimoto/altax
 public function testIterator()
 {
     $container = new Container();
     $container->set("foo", "bar");
     $container->set("foo1", "bar1");
     $container->set("foo2", "bar2");
     $container->set("foo3", " bar3");
     $container->set("foo4", "bar4");
     $i = 0;
     $status = 0;
     foreach ($container as $k => $v) {
         if ($i == 0) {
             $this->assertEquals("foo", $k);
             $status++;
         }
         if ($i == 1) {
             $this->assertEquals("foo1", $k);
             $status++;
         }
         if ($i == 2) {
             $this->assertEquals("foo2", $k);
             $status++;
         }
         if ($i == 3) {
             $this->assertEquals("foo3", $k);
             $status++;
         }
         if ($i == 4) {
             $this->assertEquals("foo4", $k);
             $status++;
         }
         $i++;
     }
     $this->assertEquals(5, $status);
     $this->assertEquals(5, count($container));
 }