You are here

public function AcsfSiteTest::testAcsfSiteUnset in Acquia Cloud Site Factory Connector 8

Same name and namespace in other branches
  1. 8.2 tests/AcsfSiteTest.php \AcsfSiteTest::testAcsfSiteUnset()

Tests the __unset() method.

Test the public interface by first setting a class property, and assuring that it is available using the __get() method. Then uset that same class property and assure that it is NOT available using the __get() method.

File

tests/AcsfSiteTest.php, line 115
Provides PHPUnit tests for Acsf Site.

Class

AcsfSiteTest
AcsfSiteTest.

Code

public function testAcsfSiteUnset() {
  $site = new AcsfSite($this->site_id);
  $data = $this
    ->getTestData();
  foreach ($data as $type => $value) {
    $site->{$type} = $value;
    $this
      ->assertSame($site
      ->__get($type), $value);
    unset($site->{$type});
    $get_value = $site
      ->__get($type);
    $this
      ->assertNull($get_value);
  }
}