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); }
/** * @dataProvider stdinProvider */ public function testBoottime($timestamp, $stdout) { $boottime = new Boottime(); $this->assertSame($timestamp, $boottime->read("echo '{$stdout}'")); }
public function testBoottime() { $fixture = __DIR__ . '/Fixtures/proc-stat-fedora20.fixture'; $uptime = new Boottime(); $this->assertEquals(1398698286, $uptime->read($fixture)); }