コード例 #1
0
 public function testClearSingle()
 {
     $calls = 0;
     $this->object->subscribe("hook", function () use(&$calls) {
         ++$calls;
     });
     $malls = 0;
     $this->object->subscribe("pook", function () use(&$malls) {
         ++$malls;
     });
     $this->object->clear("pook");
     $this->object->publish("hook");
     $this->object->publish("pook");
     $this->assertSame(1, $calls);
     $this->assertSame(0, $malls);
 }