-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Symfony 6 compatibility remove Symfony 2-3-4
- Loading branch information
Showing
6 changed files
with
32 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
|
||
namespace EasyCorp\Bundle\EasyDeployBundle\EasyDeployBundle\Tests; | ||
|
||
use EasyCorp\Bundle\EasyDeployBundle\Exception\ServerConfigurationException; | ||
use EasyCorp\Bundle\EasyDeployBundle\Server\Property; | ||
use EasyCorp\Bundle\EasyDeployBundle\Server\Server; | ||
use PHPUnit\Framework\TestCase; | ||
|
@@ -27,12 +28,10 @@ public function test_dsn_parsing(string $dsn, string $expectedHost, ?string $exp | |
$this->assertSame($expectedPort, $server->getPort()); | ||
} | ||
|
||
/** | ||
* @expectedException \EasyCorp\Bundle\EasyDeployBundle\Exception\ServerConfigurationException | ||
* @expectedExceptionMessage The host is missing (define it as an IP address or a host name) | ||
*/ | ||
public function test_dsn_parsing_error() | ||
{ | ||
$this->expectException(ServerConfigurationException::class); | ||
$this->expectExceptionMessage('The host is missing (define it as an IP address or a host name)'); | ||
new Server('deployer@'); | ||
} | ||
|
||
|
@@ -115,16 +114,16 @@ public function test_resolve_properties(array $properties, string $expression, s | |
|
||
/** | ||
* @dataProvider wrongExpressionProvider | ||
* @expectedException \InvalidArgumentException | ||
* @expectedExceptionMessageRegExp /The ".*" property in ".*" expression is not a valid server property./ | ||
*/ | ||
public function test_resolve_unknown_properties(array $properties, string $expression) | ||
{ | ||
$this->expectException(\InvalidArgumentException::class); | ||
$this->expectExceptionMessageMatches('/The ".*" property in ".*" expression is not a valid server property./'); | ||
$server = new Server('host', [], $properties); | ||
$server->resolveProperties($expression); | ||
} | ||
|
||
public function dsnProvider() | ||
public function dsnProvider(): \Generator | ||
{ | ||
yield ['123.123.123.123', '123.123.123.123', null, null]; | ||
yield ['[email protected]', '123.123.123.123', 'deployer', null]; | ||
|
@@ -143,7 +142,7 @@ public function dsnProvider() | |
yield ['ssh://deployer@host:22001', 'host', 'deployer', 22001]; | ||
} | ||
|
||
public function localDsnProvider() | ||
public function localDsnProvider(): \Generator | ||
{ | ||
yield ['local']; | ||
yield ['deployer@local']; | ||
|
@@ -158,23 +157,23 @@ public function localDsnProvider() | |
yield ['[email protected]:22001']; | ||
} | ||
|
||
public function serverRolesProvider() | ||
public function serverRolesProvider(): \Generator | ||
{ | ||
yield [[], []]; | ||
yield [[Server::ROLE_APP], [Server::ROLE_APP]]; | ||
yield [['custom_role'], ['custom_role']]; | ||
yield [['custom_role_1', 'custom_role_2'], ['custom_role_1', 'custom_role_2']]; | ||
} | ||
|
||
public function sshConnectionStringProvider() | ||
public function sshConnectionStringProvider(): \Generator | ||
{ | ||
yield ['localhost', '']; | ||
yield ['123.123.123.123', 'ssh 123.123.123.123']; | ||
yield ['[email protected]', 'ssh [email protected]']; | ||
yield ['[email protected]:22001', 'ssh [email protected] -p 22001']; | ||
} | ||
|
||
public function expressionProvider() | ||
public function expressionProvider(): \Generator | ||
{ | ||
yield [['prop1' => 'aaa'], '{{ prop1 }}', 'aaa']; | ||
yield [['prop.1' => 'aaa'], '{{ prop.1 }}', 'aaa']; | ||
|
@@ -188,7 +187,7 @@ public function expressionProvider() | |
yield [['prop1' => 'aaa', 'prop2' => 'bbb'], 'cd {{ prop1 }}{{ prop2 }}', 'cd aaabbb']; | ||
} | ||
|
||
public function wrongExpressionProvider() | ||
public function wrongExpressionProvider(): \Generator | ||
{ | ||
yield [[], '{{ prop1 }}']; | ||
yield [['prop1' => 'aaa'], '{{ prop 1 }}']; | ||
|