@@ 301-314 (lines=14) @@ | ||
298 | } |
|
299 | } |
|
300 | ||
301 | public function testExposeFixedPort() |
|
302 | { |
|
303 | $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['/bin/sleep', '1']]); |
|
304 | ||
305 | $port = new Port('8888:80/tcp'); |
|
306 | ||
307 | $container->setExposedPorts($port); |
|
308 | ||
309 | $manager = $this->getManager(); |
|
310 | $manager->create($container); |
|
311 | $manager->start($container, ['PortBindings' => $port->toSpec()]); |
|
312 | ||
313 | $this->assertEquals(8888, $container->getMappedPort(80)->getHostPort()); |
|
314 | } |
|
315 | ||
316 | public function testExposeRandomPort() |
|
317 | { |
|
@@ 316-328 (lines=13) @@ | ||
313 | $this->assertEquals(8888, $container->getMappedPort(80)->getHostPort()); |
|
314 | } |
|
315 | ||
316 | public function testExposeRandomPort() |
|
317 | { |
|
318 | $container = new Container(['Image' => 'ubuntu:precise', 'Cmd' => ['/bin/sleep', '1']]); |
|
319 | ||
320 | $port = new Port('80/tcp'); |
|
321 | $container->setExposedPorts($port); |
|
322 | ||
323 | $manager = $this->getManager(); |
|
324 | $manager->create($container); |
|
325 | $manager->start($container, ['PortBindings' => $port->toSpec()]); |
|
326 | ||
327 | $this->assertInternalType('integer', $container->getMappedPort(80)->getHostPort()); |
|
328 | } |
|
329 | ||
330 | public function testInspect() |
|
331 | { |