idSite)) { Fixture::createWebsite('2014-01-01 00:00:00'); } $this->settings = new UserSettings(new SystemSettings()); } public function test_userTrackingEnabled_ShouldBeEnabledByDefault() { $this->assertSame(true, $this->settings->userTrackingEnabled->getValue()); } public function test_userTrackingEnabled_shouldBeWritableDependingOnOptOut() { $settings = $this->createUserSettingsWithUserOptOut(false); $this->assertSame(false, $settings->userTrackingEnabled->isWritableByCurrentUser()); $settings = $this->createUserSettingsWithUserOptOut(true); $this->assertSame(true, $settings->userTrackingEnabled->isWritableByCurrentUser()); } private function createUserSettingsWithUserOptOut($optOut) { $system = new SystemSettings(); $system->canUserOptOut->setValue($optOut); return new UserSettings($system); } }