Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 14f0032

Browse files
author
fd6130
committed
update tests
1 parent 78cbbfb commit 14f0032

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

tests/Configuration/ConfigurationAdapterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ConfigurationAdapterTest extends TestCase
2121
/** @var DefaultConfiguration */
2222
private $config;
2323

24-
protected function setUp()
24+
protected function setUp(): void
2525
{
2626
$this->config = (new DefaultConfiguration(__DIR__))
2727
->sharedFilesAndDirs([])

tests/Configuration/DefaultConfigurationTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ class DefaultConfigurationTest extends TestCase
1818
{
1919
/**
2020
* @dataProvider provideHttpRepositoryUrls
21-
* @expectedException \EasyCorp\Bundle\EasyDeployBundle\Exception\InvalidConfigurationException
22-
* @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"/
2321
*/
2422
public function test_repository_url_protocol(string $url)
2523
{
24+
$this->expectException(\EasyCorp\Bundle\EasyDeployBundle\Exception\InvalidConfigurationException::class);
25+
$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"/');
26+
2627
(new DefaultConfiguration(__DIR__))
2728
->repositoryUrl($url)
2829
;
2930
}
3031

31-
/**
32-
* @expectedException \EasyCorp\Bundle\EasyDeployBundle\Exception\InvalidConfigurationException
33-
* @expectedExceptionMessage The value of resetOpCacheFor option must be the valid URL of your homepage (it must start with http:// or https://).
34-
*/
3532
public function test_reset_opcache_for()
3633
{
34+
$this->expectException(\EasyCorp\Bundle\EasyDeployBundle\Exception\InvalidConfigurationException::class);
35+
$this->expectExceptionMessage('The value of resetOpCacheFor option must be the valid URL of your homepage (it must start with http:// or https://).');
36+
3737
(new DefaultConfiguration(__DIR__))
3838
->resetOpCacheFor('symfony.com')
3939
;

tests/Server/ServerRepositoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ServerRepositoryTest extends TestCase
2020
/** @var ServerRepository */
2121
private $servers;
2222

23-
protected function setUp()
23+
protected function setUp(): void
2424
{
2525
$repository = new ServerRepository();
2626
$repository->add(new Server('host0'));

tests/Server/ServerTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@ public function test_dsn_parsing(string $dsn, string $expectedHost, ?string $exp
2727
$this->assertSame($expectedPort, $server->getPort());
2828
}
2929

30-
/**
31-
* @expectedException \EasyCorp\Bundle\EasyDeployBundle\Exception\ServerConfigurationException
32-
* @expectedExceptionMessage The host is missing (define it as an IP address or a host name)
33-
*/
3430
public function test_dsn_parsing_error()
3531
{
32+
$this->expectException(\EasyCorp\Bundle\EasyDeployBundle\Exception\ServerConfigurationException::class);
33+
$this->expectExceptionMessage('The host is missing (define it as an IP address or a host name)');
34+
3635
new Server('deployer@');
3736
}
3837

@@ -115,11 +114,12 @@ public function test_resolve_properties(array $properties, string $expression, s
115114

116115
/**
117116
* @dataProvider wrongExpressionProvider
118-
* @expectedException \InvalidArgumentException
119-
* @expectedExceptionMessageRegExp /The ".*" property in ".*" expression is not a valid server property./
120117
*/
121118
public function test_resolve_unknown_properties(array $properties, string $expression)
122119
{
120+
$this->expectException(\InvalidArgumentException::class);
121+
$this->expectExceptionMessageMatches('/The ".*" property in ".*" expression is not a valid server property./');
122+
123123
$server = new Server('host', [], $properties);
124124
$server->resolveProperties($expression);
125125
}

0 commit comments

Comments
 (0)