Ejemplo n.º 1
0
 public function testSettingsAreSingletons()
 {
     $settings = new UnitTestingSettings();
     $settings->Foo = "abc";
     $settings = new UnitTestingSettings();
     $this->assertEquals("abc", $settings->Foo);
     Settings::deleteSettingNamespace("UnitTesting");
     $settings = new UnitTestingSettings();
     $this->assertEquals(null, $settings->Foo);
 }
 public function testSessionRestore()
 {
     $session = new UnitTestingSession();
     $session->TestValue = "abc123";
     $session->storeSession();
     // We can't test PHP sessions properly within the same script. However we can verify
     // that it at least restores the data from the $_SESSION array
     Settings::deleteSettingNamespace("UnitTestingSession");
     $session = new UnitTestingSession();
     $this->assertEquals("abc123", $session->TestValue);
 }