Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/Configuration/ConfigurationAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ConfigurationAdapterTest extends TestCase
/** @var DefaultConfiguration */
private $config;

protected function setUp()
protected function setUp(): void
{
$this->config = (new DefaultConfiguration(__DIR__))
->sharedFilesAndDirs([])
Expand Down
12 changes: 6 additions & 6 deletions tests/Configuration/DefaultConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ class DefaultConfigurationTest extends TestCase
{
/**
* @dataProvider provideHttpRepositoryUrls
* @expectedException \EasyCorp\Bundle\EasyDeployBundle\Exception\InvalidConfigurationException
* @expectedExceptionMessageRegExp /The repository URL must use the SSH syntax instead of the HTTPs syntax to make it work on any remote server. Replace "https?:\/\/.*\/symfony\/symfony-demo.git" by "git@.*:symfony\/symfony-demo.git"/
*/
public function test_repository_url_protocol(string $url)
{
$this->expectException(\EasyCorp\Bundle\EasyDeployBundle\Exception\InvalidConfigurationException::class);
$this->expectExceptionMessageMatches('/The repository URL must use the SSH syntax instead of the HTTPs syntax to make it work on any remote server. Replace "https?:\/\/.*\/symfony\/symfony-demo.git" by "git@.*:symfony\/symfony-demo.git"/');

(new DefaultConfiguration(__DIR__))
->repositoryUrl($url)
;
}

/**
* @expectedException \EasyCorp\Bundle\EasyDeployBundle\Exception\InvalidConfigurationException
* @expectedExceptionMessage The value of resetOpCacheFor option must be the valid URL of your homepage (it must start with http:// or https://).
*/
public function test_reset_opcache_for()
{
$this->expectException(\EasyCorp\Bundle\EasyDeployBundle\Exception\InvalidConfigurationException::class);
$this->expectExceptionMessage('The value of resetOpCacheFor option must be the valid URL of your homepage (it must start with http:// or https://).');

(new DefaultConfiguration(__DIR__))
->resetOpCacheFor('symfony.com')
;
Expand Down
2 changes: 1 addition & 1 deletion tests/Server/ServerRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ServerRepositoryTest extends TestCase
/** @var ServerRepository */
private $servers;

protected function setUp()
protected function setUp(): void
{
$repository = new ServerRepository();
$repository->add(new Server('host0'));
Expand Down
12 changes: 6 additions & 6 deletions tests/Server/ServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ 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(\EasyCorp\Bundle\EasyDeployBundle\Exception\ServerConfigurationException::class);
$this->expectExceptionMessage('The host is missing (define it as an IP address or a host name)');

new Server('deployer@');
}

Expand Down Expand Up @@ -115,11 +114,12 @@ 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);
}
Expand Down