diff --git a/README.md b/README.md index fca9c5e..ce415a2 100644 --- a/README.md +++ b/README.md @@ -281,7 +281,7 @@ Once you have initialised your Orchestration object the following methods can be This method creates a new network and returns a boolean value indicating if the network was created successfully. ```php - $orchestration->createNetwork('name', false); + $orchestration->networkCreate('name', false); ```
@@ -305,7 +305,7 @@ Once you have initialised your Orchestration object the following methods can be This method removes a network and returns a boolean value indicating if the network was removed successfully. ```php - $orchestration->removeNetwork('network_id'); + $orchestration->networkRemove('network_id'); ```
diff --git a/src/Orchestration/Adapter.php b/src/Orchestration/Adapter.php index 9f62aba..e70e16f 100644 --- a/src/Orchestration/Adapter.php +++ b/src/Orchestration/Adapter.php @@ -43,12 +43,12 @@ public function filterEnvKey(string $string): string /** * Create Network */ - abstract public function createNetwork(string $name, bool $internal = false): bool; + abstract public function networkCreate(string $name, bool $internal = false): bool; /** * Remove Network */ - abstract public function removeNetwork(string $name): bool; + abstract public function networkRemove(string $name): bool; /** * Connect a container to a network diff --git a/src/Orchestration/Adapter/DockerAPI.php b/src/Orchestration/Adapter/DockerAPI.php index 44eb4e5..6c2aff0 100644 --- a/src/Orchestration/Adapter/DockerAPI.php +++ b/src/Orchestration/Adapter/DockerAPI.php @@ -201,7 +201,7 @@ protected function streamCall(string $url, int $timeout = -1): array /** * Create Network */ - public function createNetwork(string $name, bool $internal = false): bool + public function networkCreate(string $name, bool $internal = false): bool { $body = \json_encode([ 'Name' => $name, @@ -225,7 +225,7 @@ public function createNetwork(string $name, bool $internal = false): bool /** * Remove Network */ - public function removeNetwork(string $name): bool + public function networkRemove(string $name): bool { $result = $this->call('http://localhost/networks/'.$name, 'DELETE'); diff --git a/src/Orchestration/Adapter/DockerCLI.php b/src/Orchestration/Adapter/DockerCLI.php index e23f0b3..dd68550 100644 --- a/src/Orchestration/Adapter/DockerCLI.php +++ b/src/Orchestration/Adapter/DockerCLI.php @@ -31,7 +31,7 @@ public function __construct(?string $username = null, ?string $password = null) /** * Create Network */ - public function createNetwork(string $name, bool $internal = false): bool + public function networkCreate(string $name, bool $internal = false): bool { $output = ''; @@ -43,7 +43,7 @@ public function createNetwork(string $name, bool $internal = false): bool /** * Remove Network */ - public function removeNetwork(string $name): bool + public function networkRemove(string $name): bool { $output = ''; diff --git a/src/Orchestration/Orchestration.php b/src/Orchestration/Orchestration.php index 6e366b7..d0f52da 100644 --- a/src/Orchestration/Orchestration.php +++ b/src/Orchestration/Orchestration.php @@ -75,17 +75,17 @@ public function parseCommandString(string $command): array /** * Create Network */ - public function createNetwork(string $name, bool $internal = false): bool + public function networkCreate(string $name, bool $internal = false): bool { - return $this->adapter->createNetwork($name, $internal); + return $this->adapter->networkCreate($name, $internal); } /** * Remove Network */ - public function removeNetwork(string $name): bool + public function networkRemove(string $name): bool { - return $this->adapter->removeNetwork($name); + return $this->adapter->networkRemove($name); } /** diff --git a/tests/Orchestration/Base.php b/tests/Orchestration/Base.php index 34f53ae..ac857c3 100644 --- a/tests/Orchestration/Base.php +++ b/tests/Orchestration/Base.php @@ -185,15 +185,15 @@ public function testCreateContainer(): void /** * @depends testCreateContainer */ - public function testCreateNetwork(): void + public function testNetworkCreate(): void { - $response = static::getOrchestration()->createNetwork('TestNetwork'); + $response = static::getOrchestration()->networkCreate('TestNetwork'); $this->assertEquals(true, $response); } /** - * @depends testCreateNetwork + * @depends testNetworkCreate */ public function testListNetworks(): void { @@ -211,7 +211,7 @@ public function testListNetworks(): void } /** - * @depends testCreateNetwork + * @depends testNetworkCreate */ public function testNetworkConnect(): void { @@ -260,9 +260,9 @@ public function testNetworkDisconnect(): void /** * @depends testNetworkDisconnect */ - public function testRemoveNetwork(): void + public function testNetworkRemove(): void { - $response = static::getOrchestration()->removeNetwork('TestNetwork'); + $response = static::getOrchestration()->networkRemove('TestNetwork'); $this->assertEquals(true, $response); } @@ -725,12 +725,12 @@ public function testNetworkExists(): void $this->assertFalse(static::getOrchestration()->networkExists($networkName)); // Create network and test it exists - $response = static::getOrchestration()->createNetwork($networkName); + $response = static::getOrchestration()->networkCreate($networkName); $this->assertTrue($response); $this->assertTrue(static::getOrchestration()->networkExists($networkName)); // Remove network - $response = static::getOrchestration()->removeNetwork($networkName); + $response = static::getOrchestration()->networkRemove($networkName); $this->assertTrue($response); // Test removed network