Пример #1
0
 public function testBoottime()
 {
     $boottime = new Boottime();
     $runtime = m::mock('\\Uptime\\Runtime\\RuntimeInterface');
     $runtime->shouldReceive('read')->times(4)->andReturn(0);
     $this->assertInternalType('integer', $boottime->read($runtime));
     $this->assertGreaterThan(0, $boottime->read($runtime));
     $this->assertEquals($boottime->read($runtime), $boottime->read($runtime), null, 1);
 }
Пример #2
0
 /**
  * @dataProvider stdinProvider
  */
 public function testBoottime($timestamp, $stdout)
 {
     $boottime = new Boottime();
     $this->assertSame($timestamp, $boottime->read("echo '{$stdout}'"));
 }
Пример #3
0
 public function testBoottime()
 {
     $fixture = __DIR__ . '/Fixtures/proc-stat-fedora20.fixture';
     $uptime = new Boottime();
     $this->assertEquals(1398698286, $uptime->read($fixture));
 }