Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire committed Feb 4, 2020
2 parents e5fcc4a + c38bbdb commit c7e963b
Show file tree
Hide file tree
Showing 22 changed files with 124 additions and 31 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# https://github.com/actions/stale

name: "Stale"

on:
schedule:
- cron: "0 9-18 * * *"

jobs:
stale:
runs-on: "ubuntu-latest"

steps:
- name: "Close stale issues and pull requests"
uses: "actions/stale@v1.1.0"
with:
days-before-close: 7
days-before-stale: 180
repo-token: "${{ secrets.GITHUB_TOKEN }}"
exempt-issue-label: "keep"
stale-issue-label: "pending author"
stale-issue-message: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
stale-pr-label: "pending author"
stale-pr-message: >
This PR has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ env:
- SYMFONY_DEPRECATIONS_HELPER=max[self]=0
- TARGET=test
- UPSTREAM_URL=https://github.com/sonata-project/SonataPageBundle.git
- PHPUNIT_VERSION=7
- PHPUNIT_VERSION=8

matrix:
fast_finish: true
Expand All @@ -45,9 +45,9 @@ matrix:
- php: '7.2'
env: COMPOSER_FLAGS="--prefer-lowest"
- php: '7.3'
env: SYMFONY=3.4.*
env: SYMFONY=4.4.*
- php: '7.3'
env: SYMFONY='dev-master as 3.4.x-dev'
env: SYMFONY='dev-master as 4.4.x-dev'
- php: '7.3'
env: SONATA_ADMIN=3.*
- php: '7.3'
Expand All @@ -62,7 +62,7 @@ matrix:
- php: 7.4snapshot
- php: nightly
- env: SYMFONY_DEPRECATIONS_HELPER=0
- env: SYMFONY='dev-master as 3.4.x-dev'
- env: SYMFONY='dev-master as 4.4.x-dev'
- env: SONATA_ADMIN='dev-master as 3.x-dev'
- env: SONATA_BLOCK='dev-master as 3.x-dev'

Expand Down
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [3.14.0](https://github.com/sonata-project/SonataPageBundle/compare/3.13.0...3.14.0) - 2020-01-12
Changelog
## [3.15.0](https://github.com/sonata-project/SonataPageBundle/compare/3.14.0...3.15.0) - 2020-01-27
### Changed
- Re-allow SF DI>4.4.0
- Upgrade matthiasnoback/symfony-dependency-injection-test to ^4.0

## [3.14.0](https://github.com/sonata-project/SonataPageBundle/compare/3.13.0...3.14.0) - 2020-01-12
### Changed
- `BlockInteractor` constructor's argument $registry is now an instance of
`Doctrine\Persistence\ManagerRegistry`
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"symfony/config": "^3.4 || ^4.2",
"symfony/console": "^3.4 || ^4.2",
"symfony/debug": "^3.4 || ^4.2",
"symfony/dependency-injection": "^3.4 || ^4.2,<4.4.0",
"symfony/dependency-injection": "^3.4 || ^4.2",
"symfony/form": "^3.4 || ^4.2",
"symfony/http-foundation": "^3.4.31 || ^4.2",
"symfony/http-kernel": "^3.4 || ^4.2",
Expand All @@ -60,7 +60,7 @@
"require-dev": {
"friendsofsymfony/rest-bundle": "^2.1",
"jms/serializer-bundle": "^1.0 || ^2.0",
"matthiasnoback/symfony-dependency-injection-test": "^3.0",
"matthiasnoback/symfony-dependency-injection-test": "^4.0",
"nelmio/api-doc-bundle": "^2.4",
"symfony/phpunit-bridge": "^4.3"
},
Expand Down
4 changes: 2 additions & 2 deletions src/Form/Type/PageTypeChoiceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function configureOptions(OptionsResolver $resolver): void
/**
* NEXT_MAJOR: remove this method.
*
* @deprecated since sonata-project/page-bundle 3.x, to be removed in version 4.0.
* @deprecated since sonata-project/page-bundle 3.14, to be removed in version 4.0.
*/
public function setDefaultOptions(OptionsResolverInterface $resolver): void
{
Expand Down Expand Up @@ -85,7 +85,7 @@ public function getBlockPrefix()
/**
* NEXT_MAJOR: remove this method.
*
* @deprecated since sonata-project/page-bundle 3.x, to be removed in version 4.0.
* @deprecated since sonata-project/page-bundle 3.14, to be removed in version 4.0.
*/
public function getName()
{
Expand Down
4 changes: 2 additions & 2 deletions src/Form/Type/TemplateChoiceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function configureOptions(OptionsResolver $resolver): void
/**
* NEXT_MAJOR: remove this method.
*
* @deprecated since sonata-project/page-bundle 3.x, to be removed in version 4.0.
* @deprecated since sonata-project/page-bundle 3.14, to be removed in version 4.0.
*/
public function setDefaultOptions(OptionsResolverInterface $resolver): void
{
Expand Down Expand Up @@ -82,7 +82,7 @@ public function getBlockPrefix()
/**
* NEXT_MAJOR: remove this method.
*
* @deprecated since sonata-project/page-bundle 3.x, to be removed in version 4.0.
* @deprecated since sonata-project/page-bundle 3.14, to be removed in version 4.0.
*/
public function getName()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Twig/Extension/PageExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function initRuntime(Environment $environment): void
/**
* NEXT_MAJOR: remove this method.
*
* @deprecated since sonata-project/page-bundle 3.x, to be removed in version 4.0.
* @deprecated since sonata-project/page-bundle 3.14, to be removed in version 4.0.
*/
public function getName()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/CmsManager/CmsPageManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class CmsPageManagerTest extends TestCase
/**
* Setup manager object to test.
*/
public function setUp(): void
protected function setUp(): void
{
$this->blockInteractor = $this->getMockBlockInteractor();
$this->pageManager = $this->createMock(PageManagerInterface::class);
Expand Down
2 changes: 1 addition & 1 deletion tests/CmsManager/CmsSnapshotManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class CmsSnapshotManagerTest extends TestCase
/**
* Setup manager object to test.
*/
public function setUp(): void
protected function setUp(): void
{
$this->blockInteractor = $this->getMockBlockInteractor();
$this->snapshotManager = $this->createMock(SnapshotManagerInterface::class);
Expand Down
2 changes: 1 addition & 1 deletion tests/Command/BaseCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class BaseCommandTest extends TestCase
/**
* Sets up a new BaseCommand instance.
*/
public function setUp(): void
protected function setUp(): void
{
$this->command = $this->getMockBuilder(BaseCommand::class)
->disableOriginalConstructor()
Expand Down
2 changes: 1 addition & 1 deletion tests/Command/CreateBlockContainerCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class CreateBlockContainerCommandTest extends TestCase
*/
protected $container;

public function setUp(): void
protected function setUp(): void
{
$this->blockInteractor = $this->prophesize(BlockInteractor::class);

Expand Down
4 changes: 2 additions & 2 deletions tests/DependencyInjection/SonataPageExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ public function testDatePickerFormTheme(): void
));
}

protected function getContainerExtensions()
protected function getContainerExtensions(): array
{
return [new SonataPageExtension()];
}

protected function getMinimalConfiguration()
protected function getMinimalConfiguration(): array
{
return [
'multisite' => 'host',
Expand Down
2 changes: 1 addition & 1 deletion tests/Form/Type/PageSelectorTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class PageSelectorTypeTest extends TestCase

protected $site;

public function setUp(): void
protected function setUp(): void
{
$pages = [];

Expand Down
2 changes: 1 addition & 1 deletion tests/Form/Type/TemplateChoiceTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class TemplateChoiceTypeTest extends TestCase
/**
* setup each unit test.
*/
public function setUp(): void
protected function setUp(): void
{
$this->manager = $this->createMock(TemplateManagerInterface::class);
$this->type = new TemplateChoiceType($this->manager);
Expand Down
2 changes: 1 addition & 1 deletion tests/Listener/ExceptionListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class ExceptionListenerTest extends TestCase
/**
* setup unit test.
*/
public function setUp(): void
protected function setUp(): void
{
// mock dependencies
$this->siteSelector = $this->createMock(SiteSelectorInterface::class);
Expand Down
2 changes: 1 addition & 1 deletion tests/Listener/ResponseListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ResponseListenerTest extends TestCase
/**
* setup unit test.
*/
public function setUp(): void
protected function setUp(): void
{
$this->decoratorStrategy = $this->createMock(DecoratorStrategyInterface::class);
$this->pageServiceManager = $this->createMock(PageServiceManagerInterface::class);
Expand Down
2 changes: 1 addition & 1 deletion tests/Page/PageServiceManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class PageServiceManagerTest extends TestCase
*/
protected $manager;

public function setUp(): void
protected function setUp(): void
{
$this->router = $this->createMock(RouterInterface::class);
$this->manager = new PageServiceManager($this->router);
Expand Down
2 changes: 1 addition & 1 deletion tests/Page/Service/DefaultPageServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class DefaultPageServiceTest extends TestCase
*/
protected $seoPage;

public function setUp(): void
protected function setUp(): void
{
$name = 'my name';
$this->templateManager = $this->createMock(TemplateManagerInterface::class);
Expand Down
4 changes: 2 additions & 2 deletions tests/Request/RequestFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@

class RequestFactoryTest extends TestCase
{
public function setup(): void
protected function setUp(): void
{
Request::setFactory(null);
}

public function tearDown(): void
protected function tearDown(): void
{
Request::setFactory(null);
}
Expand Down
64 changes: 62 additions & 2 deletions tests/Resources/XliffTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,75 @@

namespace Sonata\PageBundle\Tests\Resources;

use Sonata\CoreBundle\Test\XliffValidatorTestCase;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Translation\Exception\InvalidResourceException;
use Symfony\Component\Translation\Loader\XliffFileLoader;

class XliffTest extends XliffValidatorTestCase
class XliffTest extends TestCase
{
/**
* @var XliffFileLoader
*/
protected $loader;

/**
* @var string[]
*/
protected $errors = [];

protected function setUp(): void
{
$this->loader = new XliffFileLoader();
}

/**
* @dataProvider getXliffPaths
*/
public function testXliff($path)
{
$this->validatePath($path);

if (\count($this->errors) > 0) {
$this->fail(sprintf('Unable to parse xliff files: %s', implode(', ', $this->errors)));
}

$this->assertCount(
0,
$this->errors,
sprintf('Unable to parse xliff files: %s', implode(', ', $this->errors))
);
}

/**
* @return array List all path to validate xliff
*/
public function getXliffPaths()
{
return [[__DIR__.'/../../Resources/translations']];
}

/**
* @param string $file The path to the xliff file
*/
protected function validateXliff($file)
{
try {
$this->loader->load($file, 'en');
$this->assertTrue(true, sprintf('Successful loading file: %s', $file));
} catch (InvalidResourceException $e) {
$this->errors[] = sprintf('%s => %s', $file, $e->getMessage());
}
}

/**
* @param string $path The path to lookup for Xliff file
*/
protected function validatePath($path)
{
$files = glob(sprintf('%s/*.xliff', $path));

foreach ($files as $file) {
$this->validateXliff($file);
}
}
}
2 changes: 1 addition & 1 deletion tests/Route/CmsPageRouterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class CmsPageRouterTest extends TestCase
/**
* Setup test object with its dependencies.
*/
public function setup(): void
protected function setUp(): void
{
$this->cmsSelector = $this->createMock(CmsManagerSelectorInterface::class);
$this->siteSelector = $this->createMock(SiteSelectorInterface::class);
Expand Down
2 changes: 1 addition & 1 deletion tests/Route/RoutePageGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class RoutePageGeneratorTest extends TestCase
/**
* Set up dependencies.
*/
public function setUp(): void
protected function setUp(): void
{
$this->routePageGenerator = $this->getRoutePageGenerator();
}
Expand Down

0 comments on commit c7e963b

Please sign in to comment.