Esempio n. 1
0
 /**
  * Disable registration in all required objects (Config, Router,
  * Notice+Warning+Failure Exceptions).
  * Will be executed after all register methods in this class.
  *
  * @todo disable router
  * @return void
  */
 public final function disableRegistrations()
 {
     Config::disableRegistration();
     SimpleRouter::disableRegistration();
     NoticeException::disableRegistration();
     WarningException::disableRegistration();
     FailureException::disableRegistration();
 }
Esempio n. 2
0
 public function testDisableRegistration()
 {
     Config::disableRegistration();
     /* modify user defined config */
     Config::set(2001, "XDD");
     $this->assertSame("string", Config::get(2001));
     Config::set(Config::KEY_FORCE_HTTPS, false);
     $this->assertTrue(Config::get(Config::KEY_FORCE_HTTPS));
     /* modify DIR_ROOT */
     Config::set(Config::KEY_DIR_ROOT, "/srv/www/88");
     $this->assertEquals("/srv/www", Config::get(Config::KEY_DIR_ROOT));
     /* modify Database pool 1 */
     Config::setDatabasePool(1, "mysql", "localhost", "3306", "MODIFIED", "", "db", "utf8");
     $expected1 = array(1 => "mysql", 2 => "localhost", 3 => "3306", 4 => "login", 5 => "", 6 => "db", 7 => "utf8");
     $actual1 = Config::getDatabasePool(1);
     $this->assertSame(array_diff($expected1, $actual1), array_diff($actual1, $expected1));
     /* add Database pool 4 */
     Config::setDatabasePool(4, "mysql", "localhost", "3306", "login4", "444", "db", "utf8");
     $this->assertNull(Config::getDatabasePool(4));
     /* modify Email pool 1 */
     Config::setEmailPool(1, "localhost", "25", "MODIFIED", "pass", true, "tls", "Test1");
     $expected2 = array(1 => "localhost", 2 => "25", 3 => "login", 4 => "pass", 5 => true, 6 => "tls", 7 => "Test1");
     $actual2 = Config::getEmailPool(1);
     $this->assertSame(array_diff($expected2, $actual2), array_diff($actual2, $expected2));
     /* add Email pool 4 */
     Config::setEmailPool(4, "localhost", "25", "login", "passWORD", true, "ssl", "Test3");
     $this->assertNull(Config::getDatabasePool(4));
 }