Skip to content

Commit

Permalink
Merge branch 'master' of github.com:php-translation/common into ci-php
Browse files Browse the repository at this point in the history
  • Loading branch information
bocharsky-bw committed Jan 29, 2024
2 parents eb9fa32 + c5874d1 commit ff157ea
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
],
"require": {
"php": ">=7.2",
"symfony/translation": " ^3.4 || ^4.3 || ^5.0 || ^6.0"
"symfony/translation": " ^3.4 || ^4.3 || ^5.0 || ^6.0 || ^7.0"
},
"require-dev": {
"symfony/framework-bundle": " ^3.4 || ^4.3 || ^5.0 || ^6.0",
"phpunit/phpunit": ">=8.5.23"
"symfony/framework-bundle": " ^3.4 || ^4.3 || ^5.0 || ^6.0 || ^7.0",
"phpunit/phpunit": ">=8.5.23",
"phpspec/prophecy-phpunit": "^2.1"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 2 additions & 0 deletions tests/Unit/Storage/ChainStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
namespace Translation\common\tests\Unit\Storage;

use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Symfony\Component\Translation\MessageCatalogueInterface;
use Translation\Common\Model\Message;
use Translation\Common\Storage\ChainStorage;
use Translation\Common\Storage\StorageInterface;

class ChainStorageTest extends TestCase
{
use ProphecyTrait;
private $childStorage1;
private $childStorage2;
private $storage;
Expand Down
12 changes: 6 additions & 6 deletions tests/Unit/Storage/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
2 changes: 1 addition & 1 deletion tests/Unit/XliffConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ public function testCatalogueToContent()
$catalogue->add(['foobar' => 'bar']);
$content = XliffConverter::catalogueToContent($catalogue, 'messages');

$this->assertRegExp('|foobar|', $content);
$this->assertMatchesRegularExpression('/foobar/', $content);
}
}

0 comments on commit ff157ea

Please sign in to comment.