-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 4.0: [HttpKernel] Fixed invalid REMOTE_ADDR in inline subrequest when configuring trusted proxy with subnet [FrameworkBundle] fixed guard event names for transitions [DI] Improve class named servics error message [HttpFoundation] fixed using _method parameter with invalid type [Intl] Replace svn with git in the icu data update script [HttpFoundation] Fix Cookie::isCleared
- Loading branch information
Showing
17 changed files
with
306 additions
and
270 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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Git information | ||
=============== | ||
|
||
URL: https://github.com/unicode-org/icu.git | ||
Revision: 4a3ba8eee90ea1414d4f7ee36563e6c9b28fda96 | ||
Author: Yoshito Umaoka | ||
Date: 2018-06-20T05:34:56+00:00 |
This file was deleted.
Oops, something went wrong.
73 changes: 73 additions & 0 deletions
73
src/Symfony/Component/Intl/Tests/Util/GitRepositoryTest.php
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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Intl\Tests\Util; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Symfony\Component\Filesystem\Filesystem; | ||
use Symfony\Component\Intl\Util\GitRepository; | ||
|
||
/** | ||
* @group intl-data | ||
*/ | ||
class GitRepositoryTest extends TestCase | ||
{ | ||
private $targetDir; | ||
|
||
const REPO_URL = 'https://github.com/symfony/intl.git'; | ||
|
||
/** | ||
* @before | ||
* @after | ||
*/ | ||
protected function cleanup() | ||
{ | ||
$this->targetDir = sys_get_temp_dir().'/GitRepositoryTest/source'; | ||
|
||
$fs = new Filesystem(); | ||
$fs->remove($this->targetDir); | ||
} | ||
|
||
public function testItThrowsAnExceptionIfInitialisedWithNonGitDirectory() | ||
{ | ||
$this->expectException('Symfony\Component\Intl\Exception\RuntimeException'); | ||
|
||
@mkdir($this->targetDir, '0777', true); | ||
|
||
new GitRepository($this->targetDir); | ||
} | ||
|
||
public function testItClonesTheRepository() | ||
{ | ||
$git = GitRepository::download(self::REPO_URL, $this->targetDir); | ||
|
||
$this->assertInstanceOf('Symfony\Component\Intl\Util\GitRepository', $git); | ||
$this->assertDirectoryExists($this->targetDir.'/.git'); | ||
$this->assertSame($this->targetDir, $git->getPath()); | ||
$this->assertSame(self::REPO_URL, $git->getUrl()); | ||
$this->assertRegExp('#^[0-9a-z]{40}$#', $git->getLastCommitHash()); | ||
$this->assertNotEmpty($git->getLastAuthor()); | ||
$this->assertInstanceOf('DateTime', $git->getLastAuthoredDate()); | ||
$this->assertStringMatchesFormat('v%s', $git->getLastTag()); | ||
$this->assertStringMatchesFormat('v3%s', $git->getLastTag(function ($tag) { return 0 === strpos($tag, 'v3'); })); | ||
} | ||
|
||
public function testItCheckoutsToTheLastTag() | ||
{ | ||
$git = GitRepository::download(self::REPO_URL, $this->targetDir); | ||
$lastCommitHash = $git->getLastCommitHash(); | ||
$lastV3Tag = $git->getLastTag(function ($tag) { return 0 === strpos($tag, 'v3'); }); | ||
|
||
$git->checkout($lastV3Tag); | ||
|
||
$this->assertNotEquals($lastCommitHash, $git->getLastCommitHash()); | ||
} | ||
} |
Oops, something went wrong.