/**
  * {@inheritdoc}
  */
 public function isSupported()
 {
     if (OsHelper::isMacOS() && version_compare(OsHelper::getMacOSVersion(), '10.9.0', '>=')) {
         return parent::isSupported();
     }
     return false;
 }
 public function __construct()
 {
     $this->notifier = NotifierFactory::create();
     if (self::$is_darwin === null) {
         self::$is_darwin = OsHelper::isMacOS();
     }
 }
 /**
  * {@inheritdoc}
  */
 protected function getExpectedCommandLineForNotificationWithAllOptions()
 {
     if (OsHelper::isMacOS() && version_compare(OsHelper::getMacOSVersion(), '10.9.0', '>=')) {
         return "'terminal-notifier' '-message' 'I'\\''m the notification body' '-title' 'I'\\''m the notification title' '-appIcon' '/home/toto/Images/my-icon.png'";
     }
     return "'terminal-notifier' '-message' 'I'\\''m the notification body' '-title' 'I'\\''m the notification title'";
 }
 public function testIsSupported()
 {
     $notifier = $this->getNotifier();
     if (OsHelper::isMacOS() && version_compare(OsHelper::getMacOSVersion(), '10.9.0', '>=')) {
         $this->assertTrue($notifier->isSupported());
     } else {
         $this->assertFalse($notifier->isSupported());
     }
 }
Exemple #5
0
 public function testGetMacOSVersion()
 {
     if (!OsHelper::isMacOS()) {
         $this->markTestSkipped('Can only be run on MacOS');
     }
     $expectedMacOsVersion = exec('sw_vers -productVersion', $output);
     $macOsVersion = OsHelper::getMacOSVersion();
     $this->assertRegExp('#\\d{1,2}\\.\\d{1,2}(\\.\\d{1,2})?#', $macOsVersion);
     $this->assertSame($expectedMacOsVersion, $macOsVersion);
 }