本文整理匯總了PHP中Observer::compareNotifyContext方法的典型用法代碼示例。如果您正苦於以下問題:PHP Observer::compareNotifyContext方法的具體用法?PHP Observer::compareNotifyContext怎麽用?PHP Observer::compareNotifyContext使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Observer
的用法示例。
在下文中一共展示了Observer::compareNotifyContext方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testCompareNotifyContext
/**
* Tests the compareNotifyContext method of the Observer class
*/
public function testCompareNotifyContext()
{
// Create observer passing in notification method and context
$observer = new Observer('observerTestMethod', $this);
$negTestObj = new stdClass();
// test assertions
$this->assertTrue($observer->compareNotifyContext($negTestObj) == false, "Expecting observer->compareNotifyContext(negTestObj) == false");
$this->assertTrue($observer->compareNotifyContext($this) == true, "Expecting observer->compareNotifyContext(this) == true");
}