public function testDisableRegistration() { NoticeException::disableRegistration(); /* modify single exception */ $this->assertFalse(NoticeException::set(5, 15)); $this->assertSame(1005, NoticeException::get(5)); /* modify array exceptions */ $modify = array(1 => 101, 2 => 102, 3 => 103, 4 => 104, 5 => 105); $expected = array(1 => 1001, 2 => 1002, 3 => 1003, 4 => 1004, 5 => 1005); $this->assertFalse(NoticeException::setArray($modify)); $actual = NoticeException::getAll(); $this->assertSame(array_diff($expected, $actual), array_diff($actual, $expected)); $this->assertSame(1005, NoticeException::get(5)); }
/** * Register NoticeExceptions defined in App (in this file) into NoticeException object. */ protected final function registerNoticeExceptions() { NoticeException::setArray(array(FX::N_UNKNOWN => ED::N_UNKNOWN)); }