Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Symfony 7 support #65

Merged
merged 2 commits into from
Jan 29, 2024
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
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"require": {
"php": "^7.2 || ^8.0",
"php-translation/common": "^3.0",
"symfony/translation": "^3.4 || ^4.2 || ^5.0 || ^6.0"
"symfony/translation": "^3.4 || ^4.2 || ^5.0 || ^6.0 || ^7.0"
},
"require-dev": {
"phpunit/phpunit": ">=8.5.20",
"symfony/framework-bundle": " ^3.4 || ^4.2 || ^5.0 || ^6.0"
"symfony/framework-bundle": " ^3.4 || ^4.2 || ^5.0 || ^6.0 || ^7.0"
},
"autoload": {
"psr-4": {
Expand Down
12 changes: 6 additions & 6 deletions tests/Unit/FileStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function testConstructorEmptyArray()
public function testCreateNewCatalogue()
{
$writer = $this->getMockBuilder(TranslationWriter::class)
->setMethods([$this->getMethodNameToWriteTranslations()])
->onlyMethods([$this->getMethodNameToWriteTranslations()])
->disableOriginalConstructor()
->getMock();
$writer->expects($this->once())
Expand All @@ -56,7 +56,7 @@ public function testCreateNewCatalogue()
$storage->create(new Message('key', 'domain', 'en', 'Message'));

$writer = $this->getMockBuilder(TranslationWriter::class)
->setMethods([$this->getMethodNameToWriteTranslations()])
->onlyMethods([$this->getMethodNameToWriteTranslations()])
->disableOriginalConstructor()
->getMock();
$writer->expects($this->once())
Expand All @@ -74,7 +74,7 @@ public function testCreateNewCatalogue()
public function testCreateExistingCatalogue()
{
$writer = $this->getMockBuilder(TranslationWriter::class)
->setMethods([$this->getMethodNameToWriteTranslations()])
->onlyMethods([$this->getMethodNameToWriteTranslations()])
->disableOriginalConstructor()
->getMock();
$writer->expects($this->once())
Expand Down Expand Up @@ -117,7 +117,7 @@ public function testGet()
public function testUpdate()
{
$writer = $this->getMockBuilder(TranslationWriter::class)
->setMethods([$this->getMethodNameToWriteTranslations()])
->onlyMethods([$this->getMethodNameToWriteTranslations()])
->disableOriginalConstructor()
->getMock();
$writer->expects($this->exactly(2))
Expand All @@ -139,7 +139,7 @@ public function testUpdate()
public function testDelete()
{
$writer = $this->getMockBuilder(TranslationWriter::class)
->setMethods([$this->getMethodNameToWriteTranslations()])
->onlyMethods([$this->getMethodNameToWriteTranslations()])
->disableOriginalConstructor()
->getMock();

Expand All @@ -163,7 +163,7 @@ public function testDelete()
public function testImport()
{
$writer = $this->getMockBuilder(TranslationWriter::class)
->setMethods([$this->getMethodNameToWriteTranslations()])
->onlyMethods([$this->getMethodNameToWriteTranslations()])
->disableOriginalConstructor()
->getMock();

Expand Down
7 changes: 6 additions & 1 deletion tests/Unit/XliffConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ public function testCatalogueToContent()
$catalogue->add(['foobar' => 'bar']);
$content = XliffConverter::catalogueToContent($catalogue, 'messages');

$this->assertRegExp('|foobar|', $content);
// If PHPUnit 9.0 or higher is used, use assertMatchesRegularExpression() instead
if (method_exists($this, 'assertMatchesRegularExpression')) {
$this->assertMatchesRegularExpression('/foobar/', $content);
} else {
$this->assertRegExp('|foobar|', $content);
}
}
}
Loading