| 1 | <?php |
||
| 13 | class FixedConfigTest extends PHPUnit_Framework_TestCase |
||
| 14 | { |
||
| 15 | public function testCreate() |
||
| 16 | { |
||
| 17 | $config = new FixedConfig(1); |
||
| 18 | $config->setLogger(new NullLogger()); |
||
| 19 | $this->assertEquals(1, $config->getMachine()); |
||
| 20 | } |
||
| 21 | |||
| 22 | public function testCreateWithLogger() |
||
| 23 | { |
||
| 24 | $config = new FixedConfig(1, new NullLogger()); |
||
| 25 | $this->assertEquals(1, $config->getMachine()); |
||
| 26 | } |
||
| 27 | |||
| 28 | public function testHeartbeat() |
||
| 29 | { |
||
| 30 | $config = new FixedConfig(10); |
||
| 31 | $this->assertEquals(10, $config->getMachine()); |
||
| 32 | $this->assertFalse($config->heartbeat()); |
||
| 33 | $this->assertEquals(10, $config->getMachine()); |
||
| 34 | } |
||
| 35 | } |