/** * Verify Exception throw for int attach * @expectedException Exception */ public function testAttachThrowsOnInt() { $this->obj->attach(117, 117); }
/** * @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); }