Jobby\Helper::getPlatform PHP Метод

getPlatform() публичный Метод

public getPlatform ( ) : integer
Результат integer
    public function getPlatform()
    {
        if (strncasecmp(PHP_OS, 'Win', 3) == 0) {
            // @codeCoverageIgnoreStart
            return self::WINDOWS;
            // @codeCoverageIgnoreEnd
        } else {
            return self::UNIX;
        }
    }

Usage Example

Пример #1
0
 /**
  * @covers ::checkMaxRuntime
  */
 public function testCheckMaxRuntimeShouldFailIsExceeded()
 {
     if ($this->helper->getPlatform() !== Helper::UNIX) {
         $this->markTestSkipped("'maxRuntime' is not supported on Windows");
     }
     $helper = $this->getMock('Jobby\\Helper', ['getLockLifetime']);
     $helper->expects($this->once())->method('getLockLifetime')->will($this->returnValue(2));
     $this->runJob(['command' => 'true', 'maxRuntime' => 1], $helper);
     $this->assertContains('MaxRuntime of 1 secs exceeded! Current runtime: 2 secs', $this->getLogContent());
 }
All Usage Examples Of Jobby\Helper::getPlatform