diff --git a/src/System.php b/src/System.php index cdf9e47..f8c7660 100644 --- a/src/System.php +++ b/src/System.php @@ -122,6 +122,23 @@ public function repair($executeSql = false) return $this->messages; } + /** + * Disable trackers in SugarCRM + */ + public function disableActivity() + { + \Activity::disable(); + } + + /** + * Is activity Enabled ? + * @return boolean + */ + public function isActivityEnabled() + { + return \Activity::isEnabled(); + } + /** * Taken from fayebsg/sugarcrm-cli * Useful to clean Sugar before leaving it diff --git a/tests/SystemTest.php b/tests/SystemTest.php new file mode 100644 index 0000000..a474323 --- /dev/null +++ b/tests/SystemTest.php @@ -0,0 +1,20 @@ +getEntryPointInstance(); + + $system = new System($entryPoint); + $this->assertTrue($system->isActivityEnabled()); + $system->disableActivity(); + $this->assertFalse($system->isActivityEnabled()); + } +}