diff --git a/.travis.yml b/.travis.yml index 016809ba..2fc452f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,29 +1,39 @@ +dist: xenial +sudo: required + language: php +cache: + directories: + - $HOME/.composer/cache/files + matrix: + fast_finish: true include: - php: 5.6 - php: 7.0 - php: 7.1 env: CHECK_CS=true + - php: 7.2 + - php: 7.3 -# test only master (+ Pull requests) +# test only on matching branches (+ Pull requests) branches: only: - master + - /^\d.\d+$/ before_script: - # re-enable when / if coverage is disabled for faster test runs - #- phpenv config-rm xdebug.ini - travis_retry composer selfupdate # Avoid memory issues on composer install + - phpenv config-rm xdebug.ini - echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini # Install packages - travis_retry composer install --prefer-dist --no-interaction script: - - php bin/phpunit --coverage-text - - if [ "$CHECK_CS" == "true" ]; then phpenv config-rm xdebug.ini && bin/php-cs-fixer fix -v --dry-run --diff --show-progress=estimating; fi + - php vendor/bin/phpunit + - if [ "$CHECK_CS" = "true" ]; then vendor/bin/php-cs-fixer fix -v --dry-run --diff --show-progress=estimating; fi notifications: email: false diff --git a/Tests/SystemInfo/Collector/ConfigurationSymfonyKernelSystemInfoCollectorTest.php b/Tests/SystemInfo/Collector/ConfigurationSymfonyKernelSystemInfoCollectorTest.php index 5eaac66a..0c30a8a2 100644 --- a/Tests/SystemInfo/Collector/ConfigurationSymfonyKernelSystemInfoCollectorTest.php +++ b/Tests/SystemInfo/Collector/ConfigurationSymfonyKernelSystemInfoCollectorTest.php @@ -10,10 +10,10 @@ use EzSystems\EzSupportToolsBundle\SystemInfo\Collector\ConfigurationSymfonyKernelSystemInfoCollector; use EzSystems\EzSupportToolsBundle\SystemInfo\Value\SymfonyKernelSystemInfo; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; use Symfony\Component\HttpKernel\Kernel; -class ConfigurationSymfonyKernelSystemInfoCollectorTest extends PHPUnit_Framework_TestCase +class ConfigurationSymfonyKernelSystemInfoCollectorTest extends TestCase { /** * @covers \EzSystems\EzSupportToolsBundle\SystemInfo\Collector\ConfigurationSymfonyKernelSystemInfoCollector::collect() diff --git a/Tests/SystemInfo/Collector/DoctrineDatabaseSystemInfoCollectorTest.php b/Tests/SystemInfo/Collector/DoctrineDatabaseSystemInfoCollectorTest.php index a0e0def7..613d43b1 100644 --- a/Tests/SystemInfo/Collector/DoctrineDatabaseSystemInfoCollectorTest.php +++ b/Tests/SystemInfo/Collector/DoctrineDatabaseSystemInfoCollectorTest.php @@ -10,9 +10,9 @@ use EzSystems\EzSupportToolsBundle\SystemInfo\Collector\DoctrineDatabaseSystemInfoCollector; use EzSystems\EzSupportToolsBundle\SystemInfo\Value\DatabaseSystemInfo; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; -class DoctrineDatabaseSystemInfoCollectorTest extends PHPUnit_Framework_TestCase +class DoctrineDatabaseSystemInfoCollectorTest extends TestCase { /** * @var \Doctrine\DBAL\Connection|\PHPUnit_Framework_MockObject_MockObject diff --git a/Tests/SystemInfo/Collector/EzcHardwareSystemInfoCollectorTest.php b/Tests/SystemInfo/Collector/EzcHardwareSystemInfoCollectorTest.php index ae8dd583..77e94b9e 100644 --- a/Tests/SystemInfo/Collector/EzcHardwareSystemInfoCollectorTest.php +++ b/Tests/SystemInfo/Collector/EzcHardwareSystemInfoCollectorTest.php @@ -10,9 +10,9 @@ use EzSystems\EzSupportToolsBundle\SystemInfo\Collector\EzcHardwareSystemInfoCollector; use EzSystems\EzSupportToolsBundle\SystemInfo\Value\HardwareSystemInfo; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; -class EzcHardwareSystemInfoCollectorTest extends PHPUnit_Framework_TestCase +class EzcHardwareSystemInfoCollectorTest extends TestCase { /** * @var \EzSystems\EzSupportToolsBundle\SystemInfo\EzcSystemInfoWrapper|\PHPUnit_Framework_MockObject_MockObject diff --git a/Tests/SystemInfo/Collector/EzcPhpSystemInfoCollectorTest.php b/Tests/SystemInfo/Collector/EzcPhpSystemInfoCollectorTest.php index 29b204c7..060784e1 100644 --- a/Tests/SystemInfo/Collector/EzcPhpSystemInfoCollectorTest.php +++ b/Tests/SystemInfo/Collector/EzcPhpSystemInfoCollectorTest.php @@ -10,9 +10,9 @@ use EzSystems\EzSupportToolsBundle\SystemInfo\Collector\EzcPhpSystemInfoCollector; use EzSystems\EzSupportToolsBundle\SystemInfo\Value\PhpSystemInfo; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; -class EzcPhpSystemInfoCollectorTest extends PHPUnit_Framework_TestCase +class EzcPhpSystemInfoCollectorTest extends TestCase { /** * @var \EzSystems\EzSupportToolsBundle\SystemInfo\EzcSystemInfoWrapper|\PHPUnit_Framework_MockObject_MockObject diff --git a/Tests/SystemInfo/Collector/JsonComposerLockSystemInfoCollectorTest.php b/Tests/SystemInfo/Collector/JsonComposerLockSystemInfoCollectorTest.php index 38ec431b..7875d484 100644 --- a/Tests/SystemInfo/Collector/JsonComposerLockSystemInfoCollectorTest.php +++ b/Tests/SystemInfo/Collector/JsonComposerLockSystemInfoCollectorTest.php @@ -11,9 +11,9 @@ use EzSystems\EzSupportToolsBundle\SystemInfo\Collector\JsonComposerLockSystemInfoCollector; use EzSystems\EzSupportToolsBundle\SystemInfo\Value\ComposerPackage; use EzSystems\EzSupportToolsBundle\SystemInfo\Value\ComposerSystemInfo; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; -class JsonComposerLockSystemInfoCollectorTest extends PHPUnit_Framework_TestCase +class JsonComposerLockSystemInfoCollectorTest extends TestCase { /** * @covers \EzSystems\EzSupportToolsBundle\SystemInfo\Collector\JsonComposerLockSystemInfoCollector::collect() diff --git a/Tests/SystemInfo/Registry/IdentifierBasedTest.php b/Tests/SystemInfo/Registry/IdentifierBasedTest.php index 7fd36600..e716ed97 100644 --- a/Tests/SystemInfo/Registry/IdentifierBasedTest.php +++ b/Tests/SystemInfo/Registry/IdentifierBasedTest.php @@ -9,8 +9,9 @@ namespace EzSystems\EzSupportToolsBundle\Tests\SystemInfo\Registry; use EzSystems\EzSupportToolsBundle\SystemInfo\Registry\IdentifierBased; +use PHPUnit\Framework\TestCase; -class IdentifierBasedTest extends \PHPUnit_Framework_TestCase +class IdentifierBasedTest extends TestCase { /** * @var \EzSystems\EzSupportToolsBundle\SystemInfo\Registry\IdentifierBasedEzcPhpSystemInfoCollector @@ -25,8 +26,8 @@ class IdentifierBasedTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->testItems = [ - 'foo' => $this->getMock('EzSystems\EzSupportToolsBundle\SystemInfo\Collector\SystemInfoCollector'), - 'bar' => $this->getMock('EzSystems\EzSupportToolsBundle\SystemInfo\Collector\SystemInfoCollector'), + 'foo' => $this->createMock('EzSystems\EzSupportToolsBundle\SystemInfo\Collector\SystemInfoCollector'), + 'bar' => $this->createMock('EzSystems\EzSupportToolsBundle\SystemInfo\Collector\SystemInfoCollector'), ]; $this->registry = new IdentifierBased(); @@ -67,7 +68,7 @@ public function testReplaceItem() $this->registry = new IdentifierBased($this->testItems); $replaceItems = [ - 'foo' => $this->getMock('EzSystems\EzSupportToolsBundle\SystemInfo\Collector\SystemInfoCollector'), + 'foo' => $this->createMock('EzSystems\EzSupportToolsBundle\SystemInfo\Collector\SystemInfoCollector'), ]; $this->registry = new IdentifierBased($replaceItems); diff --git a/Tests/View/Matcher/SystemInfo/IdentitifierTest.php b/Tests/View/Matcher/SystemInfo/IdentitifierTest.php index 12c0cb68..9c1477c1 100644 --- a/Tests/View/Matcher/SystemInfo/IdentitifierTest.php +++ b/Tests/View/Matcher/SystemInfo/IdentitifierTest.php @@ -8,9 +8,9 @@ use EzSystems\EzSupportToolsBundle\SystemInfo\Value\HardwareSystemInfo; use EzSystems\EzSupportToolsBundle\View\Matcher\SystemInfo\Identifier; use EzSystems\EzSupportToolsBundle\View\SystemInfoView; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; -class IdentitifierTest extends PHPUnit_Framework_TestCase +class IdentitifierTest extends TestCase { public function testMatch() { diff --git a/Tests/View/SystemInfoViewBuilderTest.php b/Tests/View/SystemInfoViewBuilderTest.php index f7714eb5..d2e6af39 100644 --- a/Tests/View/SystemInfoViewBuilderTest.php +++ b/Tests/View/SystemInfoViewBuilderTest.php @@ -4,9 +4,11 @@ */ namespace EzSystems\EzSupportToolsBundle\Tests\View; +use EzSystems\EzSupportToolsBundle\SystemInfo\Value\SystemInfo; use EzSystems\EzSupportToolsBundle\View\SystemInfoViewBuilder; +use PHPUnit\Framework\TestCase; -class SystemInfoViewBuilderTest extends \PHPUnit_Framework_TestCase +class SystemInfoViewBuilderTest extends TestCase { private $configuratorMock; @@ -33,7 +35,7 @@ public function testBuildView() $this->getRegistryMock() ); - $systemInfo = $this->getMock('SystemInfo'); + $systemInfo = $this->createMock(SystemInfo::class); $this->getRegistryMock() ->method('getItem') @@ -55,7 +57,7 @@ public function testBuildView() protected function getConfiguratorMock() { if (!isset($this->configuratorMock)) { - $this->configuratorMock = $this->getMock('eZ\Publish\Core\MVC\Symfony\View\Configurator'); + $this->configuratorMock = $this->createMock('eZ\Publish\Core\MVC\Symfony\View\Configurator'); } return $this->configuratorMock; @@ -67,7 +69,7 @@ protected function getConfiguratorMock() protected function getRegistryMock() { if (!isset($this->registryMock)) { - $this->registryMock = $this->getMock('EzSystems\EzSupportToolsBundle\SystemInfo\SystemInfoCollectorRegistry'); + $this->registryMock = $this->createMock('EzSystems\EzSupportToolsBundle\SystemInfo\SystemInfoCollectorRegistry'); } return $this->registryMock; @@ -79,7 +81,7 @@ protected function getRegistryMock() protected function getCollectorMock() { if (!isset($this->collectorMock)) { - $this->collectorMock = $this->getMock('EzSystems\EzSupportToolsBundle\SystemInfo\Collector\SystemInfoCollector'); + $this->collectorMock = $this->createMock('EzSystems\EzSupportToolsBundle\SystemInfo\Collector\SystemInfoCollector'); } return $this->collectorMock; diff --git a/View/Matcher/SystemInfo/Identifier.php b/View/Matcher/SystemInfo/Identifier.php index 01714ef8..ba25d208 100644 --- a/View/Matcher/SystemInfo/Identifier.php +++ b/View/Matcher/SystemInfo/Identifier.php @@ -48,7 +48,7 @@ public function match(View $view) private function toIdentifier($object) { - $className = get_class($object); + $className = \get_class($object); $className = substr($className, strrpos($className, '\\') + 1); $className = str_replace('SystemInfo', '', $className); diff --git a/composer.json b/composer.json index cbaca4c7..7bdff7c7 100644 --- a/composer.json +++ b/composer.json @@ -1,19 +1,23 @@ { "name": "ezsystems/ez-support-tools", - "description": "Providing information about the system eZ Platform/Studio is running on", + "description": "Providing information about the system eZ Platform/Enterprise/Commerce is running on, and eZ install itself", "license": "GPL-2.0", "type": "ezplatform-bundle", "authors": [ { - "name": "Gunnstein Lye", - "email": "gunnstein.lye@ez.no" + "name": "eZ Systems", + "email": "dev-team@ez.no" } ], "require": { - "ezsystems/ezpublish-kernel": "^6.2 || ^7.0", - "ocramius/proxy-manager": "~1.0|~2.0", - "symfony/proxy-manager-bridge": "*", - "zetacomponents/system-information": "^1.1" + "ezsystems/ezpublish-kernel": "~6.7.8 || ~6.13.4 || ^7.0", + "ocramius/proxy-manager": "~1.0 || ~2.0", + "symfony/proxy-manager-bridge": "^2.8.40 || ^3.4.11", + "zetacomponents/system-information": "^1.1.1" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2.14.2", + "phpunit/phpunit": "^5.7.27 || ^6.5.14" }, "autoload": { "psr-4": { @@ -25,14 +29,7 @@ "dev-master": "0.2.x-dev" } }, - "config": { - "bin-dir": "bin" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~2.7.1", - "phpunit/phpunit": "^4.7" - }, "scripts": { - "fix-cs": "@php ./bin/php-cs-fixer fix -v --show-progress=estimating" + "fix-cs": "@php ./vendor/bin/php-cs-fixer fix -v --show-progress=estimating" } }