コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function isSupported()
 {
     if (OsHelper::isMacOS() && version_compare(OsHelper::getMacOSVersion(), '10.9.0', '>=')) {
         return parent::isSupported();
     }
     return false;
 }
コード例 #2
0
 public function __construct()
 {
     $this->notifier = NotifierFactory::create();
     if (self::$is_darwin === null) {
         self::$is_darwin = OsHelper::isMacOS();
     }
 }
コード例 #3
0
 /**
  * {@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'";
 }
コード例 #4
0
 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());
     }
 }
コード例 #5
0
ファイル: OsHelperTest.php プロジェクト: kjmtrue/JoliNotif
 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);
 }