Skip to content
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
22 changes: 5 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,25 @@ branches:
env:
global:
- TEST_COMMAND="composer test"
- SYMFONY_PHPUNIT_VERSION="6.3"

matrix:
fast_finish: true
include:
# Test with lowest dependencies
- php: 7.1
- php: 7.2
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak"
- php: 5.5
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak" SYMFONY_PHPUNIT_VERSION="5.7"

# Test the latest stable release
- php: 5.5
env: SYMFONY_PHPUNIT_VERSION="5.7"
- php: 5.6
env: SYMFONY_PHPUNIT_VERSION="5.7"
- php: 7.0
- php: 7.1
- php: 7.2
- php: 7.3
env: COVERAGE=true TEST_COMMAND="composer test-ci"

# Force some major versions of Symfony
- php: 7.2
env: DEPENDENCIES="dunglas/symfony-lock:^2"
- php: 7.2
- php: 7.3
env: DEPENDENCIES="dunglas/symfony-lock:^3"
- php: 7.2
- php: 7.3
env: DEPENDENCIES="dunglas/symfony-lock:^4"

# Latest commit to master
- php: 7.2
- php: 7.4snapshot
env: STABILITY="dev"

allow_failures:
Expand Down
21 changes: 14 additions & 7 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log

The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release.
The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release.

## Unreleased

### Removed

Support of php < 7.2
Support of symfony < 3.4

## 1.0.1

Expand All @@ -20,10 +27,10 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee

## 0.5.0

### Added
### Added

- Support for php-translation/common: 0.3
- Added the "name" attribute on the "unit" node for XLIFF 2.0.
- Added the "name" attribute on the "unit" node for XLIFF 2.0.

## 0.4.0

Expand All @@ -37,8 +44,8 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee

### Removed

- Removed type annotation for first parameter of `FileStorage::__construct`. Type checks will be done with if-statements
to support legacy code.
- Removed type annotation for first parameter of `FileStorage::__construct`. Type checks will be done with if-statements
to support legacy code.

## 0.3.3

Expand All @@ -63,11 +70,11 @@ to support legacy code.
### Added

- Added more tests
- Improved loader and dumper of Xliff2.0 meta
- Improved loader and dumper of Xliff2.0 meta

### Changed

- We will create an output file if no file exists.
- We will create an output file if no file exists.
- Xliff2.0 is default format

## 0.2.2
Expand Down
7 changes: 1 addition & 6 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![Total Downloads](https://img.shields.io/packagist/dt/php-translation/symfony-storage.svg?style=flat-square)](https://packagist.org/packages/php-translation/symfony-storage)

This is an PHP-translation storage adapter that uses Symfony's translation writer
and loader.
and loader.

### Install

Expand All @@ -18,8 +18,3 @@ composer require php-translation/symfony-storage
### Documentation

Read our documentation at [http://php-translation.readthedocs.io](http://php-translation.readthedocs.io/en/latest/).

### Contribute

Do you want to make a change? This repository is READ ONLY. Submit your
pull request to [php-translation/platform-adapter](https://github.com/php-translation/platform-adapter).
13 changes: 7 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
}
],
"require": {
"php": "^5.5 || ^7.0",
"php": "^7.2",
"php-translation/common": "^1.0",
"symfony/translation": "^2.7 || ^3.0 || ^4.0",
"symfony/translation": "^3.4 || ^4.2",
"nyholm/nsa": "^1.1"
},
"require-dev": {
"symfony/phpunit-bridge": "^3.4 || ^4.0",
"symfony/framework-bundle": "^2.7.39 || ^3.0 || ^4.0"
"phpunit/phpunit": "^8.4",
"symfony/phpunit-bridge": "^4.2",
"symfony/framework-bundle": " ^3.4 || ^4.2"
},
"autoload": {
"psr-4": {
Expand All @@ -29,8 +30,8 @@
}
},
"scripts": {
"test": "vendor/bin/simple-phpunit",
"test-ci": "vendor/bin/simple-phpunit --coverage-text --coverage-clover=build/coverage.xml"
"test": "vendor/bin/phpunit",
"test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml"
},
"extra": {
"branch-alias": {
Expand Down
9 changes: 5 additions & 4 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
codecoverage="true"
bootstrap="./vendor/autoload.php"
>
>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
</listeners>

<formatter type="clover" usefile="false"/>
<testsuites>
<testsuite name="Tests">
<directory>./tests</directory>
Expand Down
12 changes: 6 additions & 6 deletions tests/Unit/Dumper/XliffDumperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ public function testDumpXliff12()
$dumper = new XliffDumper();
$output = $dumper->formatCatalogue($catalogue, 'messages', ['xliff_version' => '1.2']);

$this->assertContains('<source>key0</source>', $output);
$this->assertContains('<target>trans0</target>', $output);
$this->assertContains('<source>key1</source>', $output);
$this->assertContains('<target>trans1</target>', $output);
$this->assertStringContainsString('<source>key0</source>', $output);
$this->assertStringContainsString('<target>trans0</target>', $output);
$this->assertStringContainsString('<source>key1</source>', $output);
$this->assertStringContainsString('<target>trans1</target>', $output);
}

public function testDumpXliff20Meta()
Expand All @@ -49,7 +49,7 @@ public function testDumpXliff20Meta()
$dumper = new XliffDumper();
$output = $dumper->formatCatalogue($catalogue, 'messages', ['xliff_version' => '2.0']);

$this->assertContains('<note category="approved">yes</note>', $output);
$this->assertContains('<note category="state">new</note>', $output);
$this->assertStringContainsString('<note category="approved">yes</note>', $output);
$this->assertStringContainsString('<note category="state">new</note>', $output);
}
}
10 changes: 4 additions & 6 deletions tests/Unit/FileStorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,17 @@ public function testConstructor()
$this->assertInstanceOf(FileStorage::class, $storage);
}

/**
* @expectedException \LogicException
*/
public function testConstructorInvalidLoader()
{
$this->expectException(\LogicException::class);

new FileStorage(new TranslationWriter(), new TranslationWriter(), ['foo']);
}

/**
* @expectedException \LogicException
*/
public function testConstructorEmptyArray()
{
$this->expectException(\LogicException::class);

new FileStorage(new TranslationWriter(), $this->createTranslationLoader(), []);
}

Expand Down
7 changes: 3 additions & 4 deletions tests/Unit/Loader/XliffLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@
*/
class XliffLoaderTest extends TestCase
{
/**
* @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException
*/
public function testEmptyContent()
{
$this->expectException(InvalidResourceException::class);

$loader = new XliffLoader();
$loader->extractFromContent(' ', new MessageCatalogue('en'), 'messages');
}
Expand All @@ -39,7 +38,7 @@ public function testInvalidContent()
} catch (InvalidResourceException $e) {
$invalidArgument = $e->getPrevious();
$this->assertNotNull($invalidArgument);
$this->assertContains('[ERROR 4] Start tag expected', $invalidArgument->getMessage());
$this->assertStringContainsString('[ERROR 4] Start tag expected', $invalidArgument->getMessage());

return;
}
Expand Down