-
Notifications
You must be signed in to change notification settings - Fork 100
Expand file tree
/
Copy pathDefaultConfigurationTest.php
More file actions
52 lines (44 loc) · 1.87 KB
/
Copy pathDefaultConfigurationTest.php
File metadata and controls
52 lines (44 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/*
* This file is part of the EasyDeploy project.
*
* (c) Javier Eguiluz <javier.eguiluz@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace EasyCorp\Bundle\EasyDeployBundle\Tests;
use EasyCorp\Bundle\EasyDeployBundle\Configuration\DefaultConfiguration;
use EasyCorp\Bundle\EasyDeployBundle\Exception\InvalidConfigurationException;
use PHPUnit\Framework\TestCase;
class DefaultConfigurationTest extends TestCase
{
/**
* @dataProvider provideHttpRepositoryUrls
*/
public function test_repository_url_protocol(string $url)
{
$this->expectException(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)
;
}
public function test_reset_opcache_for()
{
$this->expectException(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')
;
}
public function provideHttpRepositoryUrls(): \Generator
{
yield ['http://github.com/symfony/symfony-demo.git'];
yield ['https://github.com/symfony/symfony-demo.git'];
yield ['http://bitbucket.org/symfony/symfony-demo.git'];
yield ['https://bitbucket.org/symfony/symfony-demo.git'];
yield ['http://gitlab.com/symfony/symfony-demo.git'];
yield ['https://gitlab.com/symfony/symfony-demo.git'];
}
}