コード例 #1
0
 /**
  * Verify Exception throw for int attach
  * @expectedException Exception
  */
 public function testAttachThrowsOnInt()
 {
     $this->obj->attach(117, 117);
 }
コード例 #2
0
ファイル: LoggerTest.php プロジェクト: shirone/publicapi-php
 /**
  * @depends testCanInstantiateWithoutArgument
  * @depends testHasInternalStorage
  */
 public function testDetachRemovesObserverInStorage($l)
 {
     $mockObserver = $this->getMockSplObserver();
     $splstorage = new Cpanel_Core_PriorityQueue();
     $splstorage->attach($mockObserver, 'fake');
     $rprop = new ReflectionProperty($this->cut, 'observers');
     $rprop->setAccessible(true);
     $rprop->setValue($l, $splstorage);
     $countBefore = count($splstorage);
     $l->detach($mockObserver);
     $countAfter = count($rprop->getValue($l));
     $this->assertLessThan($countBefore, $countAfter);
 }